• 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
Re: bug? NSPersistentDocument Core Data Tutorial
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug? NSPersistentDocument Core Data Tutorial


  • Subject: Re: bug? NSPersistentDocument Core Data Tutorial
  • From: Dave Fernandes <email@hidden>
  • Date: Wed, 24 Jan 2007 18:03:38 -0500

I found that the following thread gave a solution to your problem. (I had the same problem with the tutorial.) Basically, you should follow the "Adopting the Mediator Pattern" section rather than the earlier part of the tutorial. This fixed both my File->Revert exception, as well as some other notification exceptions I got when first saving the document.

Old thread...
	Subject: bug in NSPersistentDocument tutorial?
	From: Jim Balhoff <email@hidden>
	Date: Thu, 20 Apr 2006 12:31:00 -0400

Note: Your object controllers should be in Entity mode with the appropriate Entity name appearing in IB's attribute panel of the inspector.

Dave

On Jan 21, 2007, at 4:14 PM, Ryan Homer wrote:

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

_______________________________________________

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:
40utoronto.ca


This email sent to email@hidden

_______________________________________________

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


References: 
 >Re: bug? NSPersistentDocument Core Data Tutorial (From: Ryan Homer <email@hidden>)

  • Prev by Date: Re: NSAttributedString can't initWithHTML
  • Next by Date: Re: Assuring Helvetica font present
  • Previous by thread: Re: bug? NSPersistentDocument Core Data Tutorial
  • Next by thread: New source list sample code
  • Index(es):
    • Date
    • Thread