FROM : Jens Alfke
DATE : Sun Apr 20 18:15:21 2008
On 20 Apr '08, at 5:32 AM, のりちん wrote:
> I'd like to know who tells NSDocument that its location has been
> changed by other apps and how to get the notification.
I think that internally each NSDocument instance keeps an AliasHandle
pointing to the document file, and before saving resolves the alias
back to a path to compare with the current path.
> I'd like to hack before you notice something like "the document's
> location was changed, so do you want to save any other location?" when
> you open the file by an app and move the file to the other directory
> in Finder while editing the file.
I assume you've looked through the whole public API of NSDocument; if
there's nothing relevant there, it may not be possible to override
this without relying on private APIs.
—Jens
DATE : Sun Apr 20 18:15:21 2008
On 20 Apr '08, at 5:32 AM, のりちん wrote:
> I'd like to know who tells NSDocument that its location has been
> changed by other apps and how to get the notification.
I think that internally each NSDocument instance keeps an AliasHandle
pointing to the document file, and before saving resolves the alias
back to a path to compare with the current path.
> I'd like to hack before you notice something like "the document's
> location was changed, so do you want to save any other location?" when
> you open the file by an app and move the file to the other directory
> in Finder while editing the file.
I assume you've looked through the whole public API of NSDocument; if
there's nothing relevant there, it may not be possible to override
this without relying on private APIs.
—Jens
| Related mails | Author | Date |
|---|---|---|
| norio | Apr 18, 12:53 | |
| ???? | Apr 20, 14:32 | |
| Jens Alfke | Apr 20, 18:15 |






Cocoa mail archive

