views:

277

answers:

7

I have C/C++ experience so learning Objective-C is not completely foreign to me. However, I noticed that writing an application for the iPhone is not as simple as for the desktop platform. Should I start to get some solid experience on the desktop before I jump into the iPhone? I am not a commercial developer, and merely doing this as a hobby and for learning purposes. What is your recommendation?

A: 

In some ways the iPhone is simpler for a C/C++ developer. No garbage collection is the big one. If you start on the desktop and get used to GC, you'll have a hell of a time when you hit the iPhone.

gbrandt
+1  A: 

It is definitely helpful to have some Cocoa experience before going into iPhone development, but I personally wouldn't sweat it that much. Learning how to use the Cocoa framework and getting comfortable with it in general would be beneficial, but there are certain aspects of desktop Cocoa programming that you will find have little relevance to iPhone programming (e.g. user interface design with Interface Builder). Also, there are unique aspects of iPhone programming that normal Cocoa programming won't really prepare you for. (Some experienced Cocoa devs still had somewhat of a learning curve when they first got into iPhone development.)

In other words, I would recommend learning the fundamentals of normal Cocoa development, but you won't need to become a Cocoa guru in order to learn how to develop iPhone apps.

htw
I think it's true to say that a Cocoa programmer can start developing for iPhone more easily (than say a Symbian programmer) but that doesn't mean it's a good idea to become an iPhone programmer by learning Cocoa.
Roger Nolan
A: 

There is no need to or benefit in learning desktop Cocoa before moving to UiKit on the iPhone. There may be some disadvantages.

Although there are a lot of concepts shared between UIkit and Cocoa they are no easier to learn on the desktop. And at the end of the day, they are not identical. Similarly there are a lot of frameworks that are shared between iPhone and the desktop - in these cases, there is nothing to be gained from using the desktop versions before their equivalents on the phone.

There some difficulties that you will face only on the iPhone and things that might make things easier on the desktop:

  • you develop on the target machine, on iPhone, target management is more difficult
  • iPhone is memory and processor contstrained
  • there is no Garbage collection on iPhone

My view is that it is a good idea to get used to these issues as soon as possible rather than getting into "bad habits" on the desktop (or just generating misunderstanding when you go to iPhone).

Roger Nolan
+1  A: 

If your only intend in coding desktop apps is to get familiar with Objective-C, cocoa and Xcode, it is not worth.

You will learn nothing starting with desktop apps that you would not learn getting straight in iPhone apps. Desktop apps are not simpler than iPhone apps, they are just different.

It may even be counter productive if you learn specificities of desktop apps that you will have to 'unlearn' on iPhone development.

Of course, if your intend is to get into the OS X ecosystem, learning both would be very valuable.

mouviciel
A: 

The biggest challenge is not learning Cocoa and/or Cocoa Touch but Objective-C. Once you have the fundamentals Cocoa is simple and similar to many other OO frameworks.

I suggest:

  1. The Wikipedia article on Objective-C: http://en.wikipedia.org/wiki/Objective-c
  2. "External links" at Wikipedia for some fundamentals of the language
  3. Hot Cocoa podcast: http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=294050835
  4. Cocoa Cast podcast: http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=298413458
  5. Then the Stanford iPhone Application Programming course on iTunes U: http://deimos3.apple.com/WebObjects/Core.woa/Browse/itunes.stanford.edu.2024353965.02024353968
  6. Join the developer program at Apple: http://developer.apple.com
rjstelling
I really think you have that the wrong way round. Objective C is pretty straight forward for anyone coming from a C background. Cocoa is far bigger, far more fluid and complex.
Stephen Darlington
Stephen,I found the Cocoa Framework very similar to other OO Frameworks (i.e. Borland C++ that I used extensively at University) and others.I agree that a C guy will find it easy to get to grips with Objective-C - certainly easier that a C++ guy.I thin we can both agree it easier then it looks
rjstelling
+3  A: 

For what it's worth, a comment from another newcomer to iPhone development...

My background - I was a C Programmer about 15 years ago and since then I've moved around technologies quite a bit - I'm now an Adobe Flex developer in my day job. By night, however, I'm trying to transform myself into an iPhone developer ;-)

So I bought a book on iPhone SDK development - 'iPhone in Action'. I also bought 'Programming in Objective-C 2.0'. I thought I'd be set with these two but after a couple of days reading and working through exercises it was clear that... I was hopelessly lost!

So I bought another book - this time, 'iPhone SDK Development' from the Pragmatic Bookstore - this is a work in progress book but looked 'right' for me. Turns out this book took me further - it's a great piece of work - however, the early chapters were paced nicely and I was able to follow along and then all of a sudden they began to assume I could recall perfectly the lessons learnt and the procedures followed in earlier chapters and I began yet again to flounder a little - the worst thing I find when trying to learn something from a book is to have to jump around from place to place constantly to make any sense of what I'm meant to be doing.

So (yeah, I know... but bear with me...) I bought ANOTHER book... 'Beginning iPhone Development' from APress. Now THIS book assumes nothing. For a beginner to iPhone development, THIS book hits the target. No jumping around necessary and finally I found I was progressing.

However, what I'm finding is that ALL three books in CONJUNCTION with one another really seem to provide me with a more complete picture - collectively I have a great set of tutorial and reference material. The Objective-C book I've not touched on so much yet but I expect that to be what I need it to be - a reference manual for the language; I'll not need that until I'm much deeper in to the guts. I'm slowly emerging from that horrible "in at the deep end and I can't swim very well" feeling to one where I can at least tread water. Hopefully with a bit more paddling I'll be able to touch the bottom - certainly my confidence is returning ;-)

So anyway, to address the original question - personally if I did this all over again, I don't think I would have gained anything by starting out building for the Mac first and then to the iPhone. I would definitely have lost less hair had I bought the APress book first - that for me was the book that made complete sense of everything for me. I think then the 'iPhone SDK Development' Pragmatic book was the best backup/followup book. This is the path I've suggested to a colleague and I'm confident it's a good one.

Hope this helps!

Jamie.

badmanj
A: 

If you have any development experience you know that all languages are alike, and you only know if you fully grok it only by working with it.

My approach to learning a new development environment is to pick a problem you want to solve (and since the phone is in your pocket all the time, you're likely to have some idea), and bang your head on it.

There's a ton of apple sample code, answers here and on other sites. Start with a working sample app that is not too far from what you want to do, and tweak it over time. You are gratified by a working app, find out about problems right away, and can learn small bits at a time.

duncanwilcox