Not at all Cocoa-related, but as it is built upon the StackOverflow technology (now in beta for other users), it does have some vague connection to programming, or… well, no. It doesn’t, really. But I’d like to mention it to you, my fellow Cocoa-nuts, anyway. Together with a few other people, I am trying to build a knowledge-based, collaboratively built site for neuroscientists. I am very proud of our (very humble) beginnings. Hopefully, there will soon be much more content. Check it out if you like, leave a comment if you have any suggestions and if you happen to be in the (broad) field of neuroscience, don’t hesitate to ask a question (or answer one!). OK, ’nuff said about this. Next post will be pure Cocoa, promise.
Filed under: Misc. | Leave a Comment
Tags: Database, Misc.
While there are loads of iPhone developer blogs out there, many of which give good tips and/or code examples on various topics, many of them are not that well structured and may be hard to use before you’ve gotten your first project going – and actually start looking for those snippets of code to solve your specific problems.
iCodeBlog is a little different in the respect that it offers really well thought out tutorials (many of which are multiple part) on how to develop for the iPhone. Beginning with a ‘hello world‘ type project, it goes on and shows you how to use views, controllers and even how to build a fully functional (albeit simple) to do-app using SQLite. It includes some good videos too. There aren’t new posts each and every day, but the stuff that goes up there is really well made. And, unlike all too many technical blogs/tutorial sites, it has a nice, clean appearance that is not cluttered with blinking ads. If you need some step-by-step iPhone tutorials, you should check this one out.
Filed under: Uncategorized | Leave a Comment
What if you could take a course on iPhone programming at a really great university? With teachers that were actual developers themselves, in many cases working at Apple? What if you could do that in your own home, at your leisure and at zero cost?
Turns out, you can. During the spring, Stanford University put their course “iPhone Application Programming” on iTunes for anybody to download and watch. This is an actual ten week course with developers/professors Evan Doll and Alan Cannistraro, and all the lectures were taped and put on iTunes. It requires some C knowledge, and some familiarity with object oriented programming surely doesn’t hurt, but as you get to watch it at home as many times as you like, you have all the chances to read up on the stuff that’s new and unfamiliar.
If you are committed to developing for the iPhone but don’t have the time to get a CS degree at a prestigious university – this is the course for you.
Filed under: Cocoa, iPhone | Leave a Comment
Tags: iPhone, iTunes, programming, Stanford
Once your project gets to a certain size, it starts getting hard to keep track of all the different changes, tweaks and tests you’ve performed on the growing number of files in it. This is especially true if you are more than one developer working on the same project. Also, the more time and effort you’ve spent on refining that puppy, the more obvious it gets that you need some sort of backup. Preferably off site.
This is what source control management (SCM) – or Version Control – systems are designed to take care of: keeping track and managing changes in large (or small) projects with any number of people working on them. It lets you set up one or several repositories, where source code and other files are stored. Developers check out portions of code, work on it, and then check it back in (commit it). At any time, they can go back in time and look at earlier versions of the code, compare and merge with other files. The system, instead of keeping copies of all the versions of the files, keeps track of the cumulative changes made to files. This way, large projects can be worked on and changed time after time without the need for storage space increasing linearly.
I won’t try to make a tutorial on SCM here, mainly because I’m in no way an expert on this, but also because it could be (and, indeed is) the subject of several books all of its own. Instead, I will give you my take on the absolute basics of SCM and point you to some resources and apps that can make using SCM much easier.
In essence, there are two kinds of SCM models: in the client-server model, there is a central repository, which each developer works and synchronizes against. This model is utilized by Subversion (SVN), which is allegedly the fastest growing open source application for version control.
In the disrtibuted model, each developer has a local repository of his or her own, and
changes are shared between them in a separate step. Examples of distributed systems are Git and Mercurial. These systems are somewhat newer than Subversion, and are gaining popularity.
There are multiple ways to handle version control on the Mac. You can work them through the Terminal, after having installed the proper software on your computer. This may feel cumbersome if you’re not used to the Terminal.
Fortunately, there are other ways. Xcode 3.1 supports Subversion, as well as CVS and Perforce (both of which are older, client-server systems). Using Subversion from within Xcode is a breeze: after configuring your repositories, Xcode tags files that have been changed and not yet committed, and you can easily commit your changes one at a time or the whole project.
When it comes to comparing different versions of files, displaying time lines, browsing logs etc., Xcode falls short of dedicated GUI-based Subversion clients. Two of the most popular (commercial) ones are Versions and Cornerstone. As Cornerstone released its 1.5 update yesterday, both clients are now Snow Leopard and Subverions 1.6 compatible.
Long story short, I’ve tested previous versions of both these apps, and although they have lots in common – and are both great apps – I found Cornerstone to be a little better on file diff display. You can download trial versions of both apps and try them out yourself. Me – I’m sticking with Cornerstone. (A review of the two apps can be found here.)
Oh, and if you need to hook up with a Subversion host, I suggest you give Beanstalk a try. Clean, fast web interface, and the smallest account is free. Go now, and practice source control. You’ll be glad you did.
If you want to learn more about Subversion, there are lots of resources out there. Some of the ones I’ve found useful are in the Links section.
Filed under: SCM, Subversion | Leave a Comment
Tags: SCM, Version control, Subversion
Almost every blog, article, podcast or conversation about learning Cocoa will, sooner or later, mention “Cocoa Programming for Mac OS X” by Aaron Hillegass. Now in its third edition, this book has helped generations of budding Cocoa programmers getting up and running. Hillegass was once an NeXT employee, and as such knows his way around Cocoa from before it was even called “Cocoa”. The book assumes some basic C knowledge as well as some knowledge of Object Oriented Programming (OOP) (both of which you can aquire by reading the book in a prior post. It covers many of the Cocoa techniques and API:s that are used in almost every application, the kind of stuff that is what you use for 80% of any program you write. It covers only Mac, but a lot of the stuff is applicable to iPhone programming as well. The third edition is updated to OS X 10.5 (Leopard), but all of it is useful under OS X 10.6 (snow Leopard) as well. If you are new to Cocoa programming, I recommend you pick up a copy of this book. It’s worth every penny.
Filed under: Books, Cocoa, Mac | Leave a Comment
Tags: Cocoa, OS X, programming
Yes, I really think Stack Overflow is the best resource on the web for programmers, bar none. With its ingenious blend of wiki-, forum-, blog- (the latter probably the least) functionality, its blazingly fast search algorithms and the amazingly knowledgeable community that provides both questions and answers, there’s simply no better way to get answers to (specific) developer questions. There’s a well-crafted system for earning reputation (credits, badges), which serves both as a motivator for those active in the community, in addition to putting some well-balanced restriction on editing the posts of others.
It’s free to sign up, but you don’t need to have an account to search the growing number of questions in the database. You can even ask questions anonymously, but in order to earn reputation you need an account. Questions are tagged, and there is a system of voting on questions and answers, which adds a lot to the usability of the site. Most importantly, it is really not a site for argumentative discussions or social interaction – it’s a place where you ask specific programming questions in a clear fashion and get knowledgeable, useful answers in return – most of the time very fast.
Stack Overflow was created by Jeff Atwood (developer and author of the blog Coding Horror) and Joel Spolsky (founder of Fog Creek Software, well-known blogger and author of a bunch of books on software development), and although the site has only been in operation since 2008, they already have attracted a huge number of users and have up to one million page views per day. Since the great majority of these are probably programmers, that should tell you something about how good the community thinks this site is.
While aimed at all sorts of developers, Stack Overflow has a good number of questions/answers on Cocoa development for both the Mac and – especially – the iPhone. It’s heavily optimized for Google, so chances are it shows up in your search if you phrase it as a programming question. And if you can’t find the answer to your specific question on the site, you are very likely get it if you post your question there. Oh, and Joel & Jeff also do a (almost) weekly podcast with the same name. It has very little to do with Cocoa, but a lot with programming in general. And it’s very entertaining. Check that one out too.
Filed under: Resources | Leave a Comment
Tags: Cocoa, Stack Overflow
There are loads of iPhone developer help pages, tutorials and blogs out there. Some are excellent and some are, well, just as well left alone. One of the former type is iPhone developer tips (or [iPhone developer:tips]) by John Muchow. He is a developer who has been working with mobile devices for a long time, and has recently been developing several apps for the iPhone (mind you, some of them seem to be about having selections of photos of women in bikini on your phone, but whether you dig that or not might be irrelevant from a programmer’s point of view).
Being an experienced developer for mobile devices, his perspective is a little bit different from many other iPhone development bloggers. The articles on the site are often short, to the point and always very practical in nature. Typically, each describes a specific problem or task in programming for the iPhone, for which a solution or explanation is delivered. Not exactly for the beginner (although there are some longer tutorial type articles) but if you need someone to show you how to rotate an image with animation, or how to launch your app via a custom URL scheme, this might be just the site for you.
Filed under: Resources, iPhone | Leave a Comment
Tags: iPhone, programming
Becoming an Xcoder
If you haven’t done so already, you are probably eager to actually do some Cocoa programming by now. To write programs for the Mac or the iPhone (as for any other platform) you need to use special development tools. Fortunately, Apple has included all the tools you need for Cocoa development in OS X. If you don’t already have them on your computer (or on your OS X discs), you can download them from the Mac Dev Center. You need to register for the Mac Developer Program to get hold of the tools. Luckily, membership is free. If you want to develop for the iPhone, you need to register for the iPhone Developer Program in order to download the additional tools needed for iPhone development. Membership in the iPhone Developer Program is also free, but in order to run your code on a device, as well as publishing you iPhone application on the App Store, you need to pay a fee (more on that in later posts). The Dev Centers are great resources for information on development, where you can find tutorials, videos and search all of Apples documentation for developers.
Where to start, though? Development for both these platforms revolve around the Xcode IDE (Integrated Development Environment) – although Xcode also denotes the whole suite of tools. Xcode – together with Interface Builder, which is used to build the GUI of your application – is where you’ll spend most of your time as a Cocoa developer. It is a very capable tool with lots and lots of functions, and is actually what Apple’s own developers uses. It is also slightly overwhelming, especially if you are not used to working with an IDE.
If you would like to dip your toes into Cocoa development and Xcode right away, I’d like to point you to a very practical and well-written introduction to the subject: “Becoming an Xcoder” by the guys at CocoaLab. It assumes no prior programming experience at all, and starts by going through concepts like conditional statements, functions etc. before delving into simple GUI programming on the Mac. Caution: some of the screen captures are a little out of date, and they do not state that the text has been updated to OS X 10.6, but as it is a very basic text you should be fine. Also, the on-line version seems to be more updated than the Pdf. It is such a great introduction, though, so I just had to recommend it to the absolute Cocoa beginners.
Apple also has a simple, hands-on introduction which takes you through the first steps of programming with Xcode. It assumes basic C knowledge, but is naturally more updated than the suggestion above. You should also check out Apple’s “A Tour of Xcode“, which is a great overview of this feature-rich tool.
Armed with these great tutorials, there is nothing standing in your way to become a real Xcoder. Just download those tools, pour yourself a cup of coffee, click on one of the links and you’re off to the races.
Filed under: Objective-C, Xcode | Leave a Comment
Tags: Obj-C, Xcode
So where does one start?
To be sure, everyones journey is different.
I am not a professional programmer, but I’ve programmed computers on and off for almost three decades. I first realized that you could tell computers what to do by way of a special, secret language when my father showed me a book on FORTRAN, then used at the university where he worked. I was amazed, and knew that I just had to learn to talk to those machines.
Since this was the early eighties, I started out with BASIC. Typically, a program from a computer magazine would be read aloud by one person, while another one typed in the code (even then ‘development’ was often a team effort). From there, I went on to dabble in 6502 assembly code, Pascal and COMAL – the latter a consequence of the Swedish school authorities deciding on what was the utlimate programming language for kids to learn – with a special computer to go (needless to say, it was incompatible with all other systems…).
In high-school, a teacher told me that the language of the future was C, so I did a programming project which resulted in an almost functioning stock analysis program (hey, this was the 80:s!).
Ever since I got my first Mac, I’ve wanted to write programs of my own for these fine machines. Got my Code Warrior disks and everything, but the frameworks of that time (‘the Toolbox‘) was simply too user unfriendly for me to ever really get past the hassle associated with just getting a window with some content on the screen.
Enter Cocoa. When a friend of mine (with similar programming experience) introduced me to Cocoa a few years ago, I knew it was finally time to write my own Mac programs. I’ve been learning ever since, and I hope to pass on some of my experience with delving into the wonderful world of Cocoa through this blog.
OK. Maybe you come from a similar background. Or maybe you are an experienced Java programmer. Maybe you are fluent in HTML, or maybe you are used to working with CMS tools. Maybe you’re even one of those mysterious COBOL programmers that the world is apparently still full of. Either way, you need an entrance to Cocoa.
Let’s start with a book, shall we?
Some people say you absolutely have to learn C to be a real programmer. Although I do know enough C to get by, I’m not sure I agree: to me one of the biggest obstacles when learning Objective-C (or Obj-C, the language typically used for programming Cocoa) was to get out of my procedural mindset and into object-oriented (OO) thinking. Early on, I had great help with this through Stephen Cochan’s “Programming in Objective-C” (a newer edition which includes Obj-C 2.0 was recently published).
This book does not assume that you know any C. In fact, it begins by teaching Obj-C as if it were a language all of its own, and only later does it touch upon some C-specific features of the language. Of course, much of the syntax will be very familiar to those who do konw C (after all, Obj-C is just a simple superset of C), but that doesn’t get in the way of Cochan’s explaining the nuts-n-bolts of Obj-C and object oriented programming.
If you need a place to start with the Obj-C language, this book is highly recommended.
Filed under: Objective-C | Leave a Comment
Tags: Obj-C Cocoa
Recent Entries
- Shameless self-promotion: neuroknowledge.net now live!
- Quick tip: UITabBar video tutorial
- Quality iPhone programming tutorials
- iPhone programming: Stanford University
- Source Control Management made easy (sort of)
- Another book tip: Cocoa Programming for Mac OS X
- The no. 1 resource for programmers
- Quick tip: [iPhone developer:tips]
- Becoming an Xcoder
- So where does one start?
- The Mac Developer Network
Categories
- Books (1)
- Cocoa (2)
- iPhone (3)
- Mac (1)
- Misc. (1)
- Objective-C (2)
- Resources (3)
- SCM (1)
- Subversion (1)
- Tutorial (1)
- Uncategorized (1)
- Video (1)
- Xcode (1)




