On Sep 3, 2007, at 08:35, [EMAIL PROTECTED] wrote:
> Use specific @catch blocks to catch thrown NSExceptions rather than
> checking for a -name method.
How can this work? You'd need a nested exception handler inside the
@catch. I get this:
2007-09-03 09:02:06.254 test[7378:10b] *** -[NSCFString count]:
unrecognized selector sent to instance 0x204c
2007-09-03 09:02:06.266 test[7378:10b] 1: caught *** -[NSCFString
count]: unrecognized selector sent to instance 0x204c
2007-09-03 09:02:06.272 test[7378:10b] 1: name is
NSInvalidArgumentException
2007-09-03 09:02:06.276 test[7378:10b] try 2
2007-09-03 09:02:06.279 test[7378:10b] 2: caught Exceptions suck
2007-09-03 09:02:06.283 test[7378:10b] *** -[NSCFString name]:
unrecognized selector sent to instance 0x20bc
2007-09-03 09:02:06.287 test[7378:10b] *** Terminating app due to
uncaught exception 'NSInvalidArgumentException', reason: '*** -
[NSCFString name]: unrecognized selector sent to instance 0x20bc'
--
adam
// cc test.m -fobjc-exceptions -framework Foundation -o test
#import <Foundation/Foundation.h>
int main (int argc, char const *argv[])
{
NSAutoreleasePool *pool = [NSAutoreleasePool new];
NSString *eString = @"an exception";
@try {
NSLog(@"%d", [eString count]);
}
@catch(id exception){
NSLog(@"1: caught %@", exception);
NSLog(@"1: name is %@", [exception name]);
}
@try {
NSLog(@"try 2");
@throw @"Exceptions suck";
}
@catch(id exception){
NSLog(@"2: caught %@", exception);
NSLog(@"2: name is %@", [exception name]);
}
@catch(id exception){
NSLog(@"3: caught %@", exception);
}
[pool release];
return 0;
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Bibdesk-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-develop