exception/error handling question
exception/error handling question
- Subject: exception/error handling question
- From: gnat <email@hidden>
- Date: Thu, 8 Jul 2004 23:19:50 -0400
Hello,
It was suggested by the objective-c list that I should ask this over
here.
I am writing a command line tool in Obj-C, and I have run into an
issue that I can't seem to find the answer to. I populated
NSMutableArrays with ABGroup and ABPerson objects, then added the
arrays to a NSDictionary. As you would expect (though it took awhile
for it to occur to me) calling writeToFile on the dictionary failed.
My issue is how do I find the error message/code in a case like that?
I tried wrapping it in an exception handler, but the exception is never
triggered. I'm used to C where you can check errno, but that isn't
getting set correctly.
Any insight would be appreciated.
Thanks,
-dave
--- Handler block that is never triggered (i.e. nothing is printed) ---
NS_DURING
[prefs writeToFile:file atomically:YES];
NS_HANDLER
printf("Hork! But I don't know why!!!!\n");
NSLog(@"%@", localException);
NS_ENDHANDLER
--- Prints the message, but I don't know how to get more info ---
if (![prefs writeToFile:file atomically:YES]) {
printf("Hork! But I don't know why!!!!\n);
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.