Re: Core Data and Document Packages
Re: Core Data and Document Packages
- Subject: Re: Core Data and Document Packages
- From: Tim Perrett <email@hidden>
- Date: Thu, 12 Jul 2007 13:45:06 +0100
Hey Sergio
- or you control what goes into the recent docs menu; this can be done
by subclassing NSDocumentController and overriding its
noteNewRecentDocumentURL: method. This goes like this: in your
MainMenu.nib subclass and instantiate NSDocumentController, then add
the new class definition to your code:
Very nice, I wasnt aware of NSDocumentController. I also had to add
an init method;
def init
super_init()
end
But otherwise the recent item menu then displays the package not the
datafile - certainly a good thing :)
Otherwise, in terms of the implementation code to actually get the
URL for the data file, I threw together the code you posted up
earlier in the thread and found a few problems with it; namely you
cant re-open documents once they have been saved (the saving works
perfectly however), and you are calling a method dataFilePath() for
which there is no definition. I am guessing you mean to actually
access the data file with that method, so is that the same function
as packagePath() ?
If your working with a core data based document you will need to use
the configurePersistentStoreCoordinatorForURL_ofType() method wont
you? Apart from it will somehow need to pass the data file within the
package rather than the package url itself?
Cheers
Tim Perrett
_______________________________________________
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