• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
exception/error handling question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: exception/error handling question
      • From: Bob Ippolito <email@hidden>
    • Re: exception/error handling question
      • From: Greg Hulands <email@hidden>
  • Prev by Date: [ANN] AppKiDo 0.91 and the Xcode beta
  • Next by Date: Re: exception/error handling question
  • Previous by thread: [ANN] AppKiDo 0.91 and the Xcode beta
  • Next by thread: Re: exception/error handling question
  • Index(es):
    • Date
    • Thread