iPhone
Objective-C Woes PDF Print E-mail
Written by William Grim   
Sunday, 17 May 2009 04:33

As I've gotten more and more into iPhone development, I've begun to really enjoy the Objective-C environment. I enjoy its SmallTalk-like message-passing due to all the flexibility it has to offer; however, I'm not so impressed with the compiler front-end Apple has chosen to use with ObjC.

I'm referring mainly to the alloc-init pattern employed all over ObjC. In typical usage, you will perform something like this: NSMutableDictionary *d = [[NSMutableDictionary alloc] init];. However, Objective-C does not prevent you from simply putting NSMutableDictionary *d = [[NSDictionary alloc] init];.

The problem stems from the fact that the init routine, in typical usage, must return the id type, and the compiler assumes that id can be assigned to any ObjC type. However, as witnessed in an earlier example, this is not the case.

In my personal opinion, I think at least a few more basic compiler checks are in order, starting with the case above. Given that the language is heavily dependent on runtime symbol resolution, I don't expect it to catch every error, but it can certainly do more checks than it does now. If I ever find myself with any free time (pretty doubtful), I'll see if I can't submit a patch; hopefully someone from Apple or somewhere else will see my post and implement this idea. Hmm... speaking of that, perhaps I'll submit a bug report to Apple directly and see what results we can get.

Last Updated on Sunday, 17 May 2009 04:41
 
UIViewController Subclassing: UINavigationController and UIView Lazy-Loading PDF Print E-mail
Written by William Grim   
Tuesday, 24 February 2009 05:31

UPDATE: As of SDK 3.0, this problem has disappeared. However, I have left the following article for those still wishing to work in the older SDKs.

I'm a bit of a newb to iPhone development and Cocoa-based development in general. However, I've been getting my hands dirty on a project I'm working on with some friends, and I found myself wanting to subclass a UIViewController in order to push it onto a UINavigationController. Needless to say, I ran into a few snags along the way and thought I would share some tips that may save you a few hours of frustration.

Last Updated on Tuesday, 23 June 2009 18:36
Read more...
 


cheap viagra | order viagra | viagra price | order viagra | viagra online no prescription | cialis online no prescription | viagra no prescription | viagra canada no prescription | viagra price | discount viagra online