« February 2005 | Main | April 2005 »
#import <Foundation/Foundation.h>
int main (int argc, const char *argv[])
{
NSAutoreleasePool *pool;
NSDictionary *dictionary;
IMP imp;
pool = [[NSAutoreleasePool alloc] init];
dictionary = [NSDictionary dictionaryWithObject:@"VfL"
forKey:@"Bochum"];
NS_DURING
[dictionary selectorThatDoesNotExist];
NS_HANDLER
NSLog( @"Exception: %@", localException);
NS_ENDHANDLER
NSLog( @"Calling unimplemented messages via objc_msgSend can be caught");
NS_DURING
imp = [dictionary methodForSelector:@selector( selectorThatDoesNotExist)];
(*imp)( dictionary, @selector( selectorThatDoesNotExist));
NS_HANDLER
NSLog( @"Exception: %@", localException);
NS_ENDHANDLER
NSLog( @"And calling them via IMP can also be caught");
[pool release];
return( 0);
}
This page contains all entries posted to Nat!'s Web Journal in March 2005. They are listed from oldest to newest.
February 2005 is the previous archive.
April 2005 is the next archive.
Many more can be found on the main index page or by looking through the archives.