PDA

View Full Version : Starting with Cocoa




pigoz
Aug 24, 2007, 11:54 AM
One of the main reasons I wanted to switch to a Mac is to program with the Cocoa API. I wanted to ask what should I start reading before getting my hands dirty with it. Books, tutorials, guides, everything is welcome ;) (I'm very familiar with C and JAVA, so I'd appreciate a lot something that gets into advanced topic rapidly).

Btw, do you think its better to wait for Xcode3 and Obj-C 2 to get out? I read Ob-C2 will not be retrocompatible, so I assume it will be quit different. I don't want to lean something that will get outdated in to months or so.. :)

thanks for reading and for the replies :D



whooleytoo
Aug 24, 2007, 12:25 PM
http://www.cocoadevcentral.com
http://www.macdevcenter.com

Two of the best links, with plenty of tutorials.

As with learning most things, it's easiest when you have a specific goal/project in mind to keep you focused; so I'd recommend putting together a project (such as, say, a media library app) which requires knowledge of several areas (persistent storage, list/table views, image/video views, etc.)

Then you can build your experience - using the tutorials above - piece by piece. For example:
1) Build an application that scans a folder on the hard drive and makes a list of all the media (image, sound & movie) files.
2) Display a window with a list view which shows the list you've built.
3) Display a preview window for the selected file when double-clicked (use QuickTime to display/play the file).
4) Save the list on exit, and load it on launch, so you don't have to scan every time.

The classes which will be especially useful: NSString (for managing paths), NSWorkspce (for browsing directories), NSMutableArray (for storing collections of any kind of Cocoa objects, such as NSStrings). Xcode has an excellent documentation browser for find references for these classes.

Nutter
Aug 24, 2007, 12:39 PM
See this page:
http://guides.macrumors.com/Helpful_development_resources

I'd recommend the Hillegass book. Since you're already familiar with C, this book is perfect for you.

Don't worry about Xcode 3 and Objective-C 2. Objective-C 2 is a superset of the existing Objective-C language, so it doesn't replace anything, it just offers new features. The new features don't fundamentally change the language in any way.

pigoz
Aug 24, 2007, 01:17 PM
thanks a lot for the advices, now I just need the iMac to be shipped :D