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



Hi,

> I would agree with seth that you dont want it to appear to the user   
> what is inside the bundle, I too am trying to achive somthing like 

I also agree with this. furthermore, I would say that it's a must that
the data file url does not appear in the recent documents menu (it won't
obviously work, since the url is changed in the initWithURL method, so
it would point to the wrong place -- unless you make some additional
check in initWithURL and do the url trick only when necessary)...

> this and would be interested in putting something rough together as   
> an example implementation. Sergio has started it in RubyCocoa, so it   
> would probably not take much to get a more robust working sample   
> together. 

I see 2 strategies to deal with the recent document issue introduced by
the implementation I proposed:

- either you don't need a recent docs menu and you remove it fully (as
  documentend in a technote from apple);

- 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:

class MyDocumentController < OSX::NSDocumentController
  def packageURLFromDataStoreURL(url)
# YOUR IMPLEMENTATION HERE
  end

  def noteNewRecentDocumentURL(url)
    packageURL = packageURLFromDataStoreURL(url)
    super_noteNewRecentDocumentURL(url)
  end
end

it would be nice using ruby metaprogramming feature to add the
noteNewRecentDocumentURL method to the shared
OSX::NSDocumentController.sharedDocumentController (without having to
subclass NSDocumentController, that is), but it did not work for me...

sergio


-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
_______________________________________________

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



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.