Re: Core Data and Document Packages
Re: Core Data and Document Packages
- Subject: Re: Core Data and Document Packages
- From: Seth Willits <email@hidden>
- Date: Tue, 10 Jul 2007 13:14:26 -0700
On Jul 10, 2007, at 11:40 AM, sergio wrote:
Hi all,
this is my first message to the list, and I hope it can be useful
to some of you, particularly to Seth, that raised the initial
question...
I have been looking into how making NSPersistenDocument work with
package documents. I ran into the very same problems described in
this thread, but could finally get to a working implementation.
Here it goes (it's ruby, using the rubycocoa bridge, I hope it's ok
with anyone; conversion to Objective C is straightforward, change
underscores in method names to :s, intertwine arguments, add some
memory management...). The very basic idea is overriding the
initialization method, do the url trick there, and everything
(except the recent documents menu, but this could be easily fixed
if you need it) magically works. For me, that's to say... :-)
Two things. First, I think your approach could be simplified by
overriding setFileName: and modifying the path to point inside of a
package there (not quite sure, but it seems like it would work to
me). But second, the UI (such as the proxy icon menu, and recent
menu) will show the path inside of the package rather than the
package itself which is odd for the user, so keeping the document url
as the package itself is a good idea in my book.
It was interesting to see more rubycocoa code :)
--
Seth Willits
_______________________________________________
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