Re: bug? NSPersistentDocument Core Data Tutorial
Re: bug? NSPersistentDocument Core Data Tutorial
- Subject: Re: bug? NSPersistentDocument Core Data Tutorial
- From: Ryan Homer <email@hidden>
- Date: Sun, 21 Jan 2007 16:14:40 -0500
I have encountered the same problem and even when I return YES, it
still does not work properly; I no longer get the error mentioned,
but the revert still does not work properly, leaving most if not all
of the data before the revert.
This makes some sense. If the super's method is not called, then we
are not really "reverting". However, calling it crashes the
application, even after following the additional steps indicated in
the tutorial (also here: http://lists.apple.com/archives/cocoa-dev//
2006/Apr/msg02276.html) to work around the "bug".
Has anyone figured out how to properly revert?
--------------
Subject: bug? NSPersistentDocument Core Data Tutorial
From: Chris Outwin <email@hidden>
Date: Sat, 11 Nov 2006 11:51:00 -0600
After reading about a bug in the NSPersistentDocument tutorial
( previously reported at: http://lists.apple.com/archives/cocoa-dev/
2006/Apr/msg02276.html ), I would like to ask about a similar issue:
The tutorial's Adding a Department Object chapter includes a section
entitled Supporting Document Revert. The code there calls the super
class' version of revertToContentsOfURL:.
- (BOOL)revertToContentsOfURL:(NSURL *)inAbsoluteURL ofType:(NSString
*)inTypeName error:(NSError **)outError
{
[departmentController setContent:nil];
[self setDepartment:nil];
return [super revertToContentsOfURL:inAbsoluteURL ofType:inTypeName
error:outError];
}
However, while using the tutorial to learn Core Data, I found my app
crashes when the super class' version of revertToContentsOfURL: is
called. (Department/p1> has been invalidated. is seen in the
console. ) When I simply return YES in lieu of calling the super
class version, my app seems to work.
return YES; //[super revertToContentsOfURL:inAbsoluteURL
ofType:inTypeName error:outError];
Is returning YES the correct procedure here?
Thank you,
Chris Outwin
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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