Objective Cee Platform

StevenNewton has the Objective-C version running the arithmetic tests using Project Builder on Apple's OS X.

Steven drops by WardCunningham's house in Portland, Oregon, to show him how the implementation is coming along.

This is my first significant Objective-C effort. I'd be very thankful if there were any experts interested in commenting on the implementation. I'm afraid it's not very idiomatic, for one.

I couldn't have done it without the help of the collected wisdom on the CocoaDev wiki at http://www.cocoadev.com/.

For various reasons, I ended up not workshopping this code at the software MFA trial run. We did use the Java version of FIT for an exercise, though.

Lessons learned

  • No method overloading. Objective-C complains if you try to define two methods that differ only in the types of the parameters. The solution is to "mangle" the names manually, so for example mark: (Parse *) rows and mark: (NSArray *) rows become markParse: (Parse *) rows and markArray: (NSArray *)

  • Objective-C is somewhat reflection-challenged. Because the core primitives are ordinary C, it has all the limitations of that language's type system.

  • The NSNumber and NSString types are easy to work with, but differentiating between int/long/double/float with NSNumber is unsatisfactory.

  • The default isEqual implementation in NSObject is a pointer comparison, and it appears that it is rarely overridden in the Foundation types.

  • The BOOL "type" is just a typedef for char. True/YES is one and False/NO is 0. I ended up converting all BOOL to NSNumber using numberWithBool.

  • Thank you to Malte Tancred & Peter Lindberg, authors of ObjcUnit.

  • ProjectBuilder is a decent development environment, but I really miss the code completion and on-the-fly syntax checking of Eclipse, not to mention automated refactoring. Perhaps XCode will have these?

  • XCode is better. It has code completion, or Code Sense as it's called.

  • There's no support for name spaces, so I made the decision to translate package names into prefixes, making the first element all caps, and any remaining elements camel case. So eg.music.MusicBrowser becomes EGMusicMusicBrowser. I'm open to other suggestions.

  • alloc/dealloc/retain/release SIG_SEGV EXC_BAD_ACCESS. Being back in the stone ages of memory management is no fun at all.


Last edited January 21, 2004
Return to WelcomeVisitors