Hey, I’m starting to learn how to develop applications for the iPhone, so I thought I’d start sharing what I find along the way.
First, I picked up two books:
Turns out, I’m not quite ready for those books. But a peek at the first few pages in each told me that my Ruby background would help me learn the basics of C, Objective-C, and my Rails and RubyGem API experience should guide me through the iPhone SDK. If you’re like me, feel free to buy them now. The tutorials for C and Objective-C aren’t long, and the books promise this will be enough knowledge to learn with.
So the next thing I did (which should have been the first thing I did) was find C and Objective-C tutorials:
- Learn C for Cocoa
– This is enough C knowledge to learn Objective-C - Learn Objective-C
I’m only up to “chapter” 6 on Objective-C, but so far the concepts are pretty simple. Some things I don’t like and other things I do like.
In C, variable types must be declared. In Ruby, that’s not the case. And you have to use type conversion (casting) to get different results. If you’re confused about what this means, the C for Cocoa tutorial should help. I prefer Ruby’s duck typing. It’s less to write and worry about. Functions have to be typed, too. Yech.
In C, you can define a function and implement it later or in a separate file. I think that’s kind of nice. You can quickly scan what type the functions return, their names, their arguments and what types they should be; all without the code in between.
In C, you can declare your own types! That’s pretty cool. It’s kind of similar to creating a class in Ruby.
In Objective-C, so far I’ve created a class and I had to declare the getters, the setters and the methods. And the methods just return the getters that are set by the setters. It’s weird. But it’s probably just a ridiculously simplified model to teach me how those things interact.
That’s all for now. I’m going to keep sharing as I go.