Other Stuff

UoM::RCS::Talby


Page Contents:


Page Group:

2010:

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) {
          @throw;
        }
      @finally {
        }

      return 0;
    }
For more, see the Apple documentation.

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