views:

1491

answers:

6

I have developed in C++ many years ago, but these days I am primarily a Java software engineer. Given I own an iPhone, am ready to spring for a MacBook next month, and am generally interested in getting started with Mac OS developmentmt (using Objective C), I thought I would just put this question out there: What Next?

More specifically, what books should I pick up, and are there any web resources that some folks could point me to? Some books that I am planning to purchase:

Anyone familiar with these titles? Finally, I would be very interested in a summary of what I should be prepared to expect, once I embark on this journey. As someone that develops in Java using IntelliJ IDEA, what are some key differences I will notice as I move over to writing ObjectiveC code in Xcode? What's the differences between Mac OS desktop development and iPhone development? Being used to Java garbage collection, what should I know about ObjectiveC garbage collection / memory management. Any other language specific issues that anyone would like to point out? How about building UIs? Is it closer to Swing, building Visual C++ resource files that code interacts with, or is it more like some of the borland IDEs that will generate code for guis?

+1  A: 

Get Cocoa Programming for Mac OS X. Most of your questions will be answered by that book. You can also start reading Become an XCoder and Cocoa Dev Central.

The iPhone SDK is still under NDA so you wont be able to find any online resources about it except for the one provided by Apple.

Cocoa UI is based on MVC. You use Interface Builder to design your views and then bind it to your models and controllers. Objective C is a mixture of C and Smalltalk.

jop
Sorry to unaccept your answer. It was very helpful. I just want to help out the newbie (Michael Buckley) by accepting his. Thanks!
Ryan Delucchi
No problem. His answer is more informative than mine. I even voted it up!
jop
A: 

Another option for you is jaiPhon, which allows you to write java apps that get translated into iPhone-speak at build time.

I don't know if it's availanle yet, or if it's commercial-ware or whatever, but it's interesting none the less.

http://www.jaiphon.com/

skaffman
Interesting. Honestly though, I would think that there is something to be said for learning Objective C, the programming environment and xCode. The lack of native Java support for the iPhone is dissapointing but I like what I've been reading about the Mac development tools.
Ryan Delucchi
wait a minute .. I checked their site ... looks like vapor-ware ... :-(
Ryan Delucchi
You will need to learn to work with the system on the level that debuggers and other tools expose to you, or you will be completely lost the instant you go outside the translation tool boundaries.
Thorbjørn Ravn Andersen
+6  A: 

Having purchased both of the books in your question, I recommend Cocoa Programming for Mac OS X as a quick way to learn the language and the Cocoa framework, and is probably the fastest way to start producing real applications in Cocoa. I highly recommend it. Programming in Objective-C 2.0 is a great reference book, but if you already know C, there's no much it's going to teach you that you can't pick up from the other book. However, if you ever need to a list of all the reserved keywords in Objective-C, that's the book to go to.

All of the user interface can be generated progmatically, but you'll find it much easier to use Interface Builder, which comes with XCode, to lay out the user interface. You'll end up with a lot less code. With bindings, you can even eliminate code which isn't directly related to laying out the interface. The details are in the Cocoa Programming for Mac OS X book.

The one big thing I miss from Java is the collection API. In Cocoa, you just get NSSet, NSArray, and NSDictionary, and there's no analog to the Comparable interface. These classes are also immutable, but have mutable versions such as NSMutableArray.

I actually haven't played with the Garbage Collection in Objective-C 2.0. In previous versions of Objective-C, memory management was handled by the retain, release, and autorelease methods. Objects were created with a retain count of 1. Retaining incremented that count, releasing decremented it, and autoreleasing objects is a little more complicated. Again, the Cocoa Programming book explains it well. Garbage collection is an option, and if it's turned on, the retain, release and autorelease methods do nothing. However, if you are writing a library or framework to be used by others, you should program it as if garbage collection is turned off. That way applications can use it whether or not they have garbage collection turned on.

As for Web resources, http://cocoadevcentral.com/ is a great site with beginner tutorials. The CocoaDev Wiki at http://www.cocoadev.com/ contains detailed information on a lot of topics, and you can usually find some useful information and people on the cocoa-dev mailing list http://lists.apple.com/mailman/listinfo/cocoa-dev

iPhone development is a little different, and the details are restricted by an NDA. However, if you get approved by Apple to get access to the iPhone developer center, Apple has provided some great video overviews of the differences, which point you to the documentation you need to make the jump from Mac OS X to iPhone OS X programming.

Michael Buckley
A: 

Also check out this:

http://www.xmlvm.org/overview/

It is a project that attempts to be able to cross-compile programs written in a variety of source languages to a variety of target languages. One of the initial test cases was to write programs in Java and run them on an iPhone. Watching the video on the site is worthwhile.

With that said, I haven't tried it. The project seems quite beta, and there isn't a lot of activity on their SourceForge site.

A: 

Are you already familiar with the square brackets?

Here's a brief of its rationale from my point of view. I hope this may helps also.

OscarRyz
A: 

I think you will feel rather naked when jumping from IntelliJ to Xcode. But this is just from a tool-perspective. Bring extra clothes (TextMate+FScript)!

cschreiner
textmate over xcode for obj-c development? i disagree. xcode is awesome. and it's free ;)
lajos
I definitely miss a lot from IntelliJ. But, XCode appears to happen a very different set of philosophies behind it so I am going to reserve judgement until understand those philosophies and start writing some non-trivial apps using it.
Ryan Delucchi