• 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: Core Data and Document Packages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data and Document Packages


  • Subject: Re: Core Data and Document Packages
  • From: sergio <email@hidden>
  • Date: Thu, 12 Jul 2007 12:37:05 +0200

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Core Data and Document Packages
      • From: Tim Perrett <email@hidden>
  • Prev by Date: Changing the behavior of 'Return' in NSTableView
  • Next by Date: Re: Cross-platform toolkit with a Cocoa backend
  • Previous by thread: Re: Core Data and Document Packages
  • Next by thread: Re: Core Data and Document Packages
  • Index(es):
    • Date
    • Thread