Objective C/Cocoa Learning curve

Lately I have been getting pretty motivated to learn Objective-C and it’s been a fun process so far. However, having done Ruby and rails for over a year now, it’s definitely a challenge to grasp Objective-C. Ruby definitely spoils you, and I feel I have fallen in that trap and now slowly trying to get out of the hole. On more than one occasion I have been tempted to do this:

UIImageView *image = [self findImage:touchLocation];

image.methods

Then I recall this is not ruby, :) Of course, there’s the quick ‘Jump to definition’ feature of Xcode that helps a lot.

As far as the convention quirks goes, it took me a while to whether use BOOL values as YES/NO or TRUE/FALSE or true/false. I switched back and forth for a while going by forums and what not, I was doing things like:

valid_move = YES

if valid_move == YES

Until I found a sample code from ADC, and they use it like:

valid_move = YES

if (valid_move) //How convenient, why not just set value as TRUE, I still don’t get the YES/NO macros for BOOL. Actual value stored is either 0 or 1 of course. Oh well, if it’s coming from sample code, I might as well follow the same convention. The challenge so far has been just getting used to the syntax and getting used to convention more than anything and also brush up on C pointers.

Although there are few blogs/tuts on iphone sdk and objective-C, I think the sample codes from ADC are the best source to learn what the SDK has to offer and how to use all the libraries. Besides getting hand of coding style, convention, just running the sample codes locally gives a better understanding. I was tempted to buy a iPhone app book from pragmatic programmer’s but decided not to. The ADC guidelines, code samples, floating tuts and my objective-C book should keep me busy for a while.


This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

5 Responses to “Objective C/Cocoa Learning curve”

Leave a Reply