Re: Upgrading NSDocument format, best practice
Re: Upgrading NSDocument format, best practice
- Subject: Re: Upgrading NSDocument format, best practice
- From: Markus Spoettl <email@hidden>
- Date: Wed, 16 Sep 2009 16:36:38 +0200
On Sep 16, 2009, at 4:15 PM, I. Savant wrote:
To do so I set -fileURL to NIL and tell the document it has been
loaded from a different file using -updateChangeCount:
Um ... yuck. :-} It reminds me of all the SciFi shows where the
hero jams something into the electronic lock mechanism (or shoots it
with an energy weapon) and the door pops open. Worst. Lock. Ever. In
reality, such an action is more likely to guarantee the door won't
be able to be opened, having affected the mechanism in unexpected
(and likely unwanted) ways ...
Similarly, it's generally a bad idea to short-circuit Cocoa
mechanisms if you can possibly help it.
I agree. Completely.
Before I implemented this little - um - trick, I did read the
NSDocument guide (again), more specifically the message flow section.
While I can't know for sure that -setFileURL: during a -
readFromData::: won't fry NSDocument's innards, it sure isn't spelled
out as such a dangerous thing to do.
But point taken, I don't really know if its save to do what I do.
Regards
Markus
--
__________________________________________
Markus Spoettl
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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