Re: Default Core Data errors
Re: Default Core Data errors
- Subject: Re: Default Core Data errors
- From: Rick Mann <email@hidden>
- Date: Wed, 14 Oct 2009 11:39:43 -0700
Well, I discovered the willPresentError delegate method. From that, I
got:
(gdb) po inError
Error Domain=NSCocoaErrorDomain Code=256 UserInfo=0x200272ea0 "The
document “ Untitled.telem” could not be opened. "
(gdb) po [inError userInfo]
{
NSLocalizedDescription = "The document \U201cUntitled.telem\U201d
could not be opened. ";
}
Not particularly helpful. I wonder if there's some non-Core Data,
fundamental doc-handling thing going on here.
On Oct 14, 2009, at 10:38:47, Kyle Sluder wrote:
On Wed, Oct 14, 2009 at 10:30 AM, Rick Mann <email@hidden>
wrote:
Is there a way I can get at that programmatically, rather than via
gdb? I'm
very clumsy in gdb.
Your time will be better spent learning how to use the debugger.
Quick crash course:
1. Use `po` to print objects. Example:
po theError
<NSError 0x12345678>
2. Use regular ObjC syntax to call methods on objects. Sometimes you
need to provide type information, because gdb doesn't have as much
information available to it as the compiler does. Example:
po (id)[theError description]
"The document could not be opened."
3. Use the `call` command to call arbitrary functions, methods, etc.
Again, casting might be necessary.
call (void)NSLog(@"The error says: %@", (id)[theError description])
debugged-process[2134] 00:00:00 The error says: The document could not
be opened.
Of course, use the Debugger panel to select different stack frames,
which in turn affects what variables are in scope.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden