Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data and Document Packages



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: Core Data and Document Packages (From: sergio <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.