Other Stuff


Page Contents:

Page Group:


2009: 2008:

Related Pages:

Objective-C Developments: Exceptions and Garbage-Collection

For some while Objective-C was did not have what I'd call "real" exception handling. Thankfully the tried-and-tested Modula-3 style exception handling is now part of the language:

  #import <objc/Object.h>

  int main(int argc, char* argv[]) {

      @try {
          Object* obj = [Object new];
      @catch (id ue) {
      @finally {

      return 0;
For more, see the Apple documentation.

And it seems that Objective-C 2.0 will have garbage-collection too.