• 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: Packages vs. Finder (perceived stability problem)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Packages vs. Finder (perceived stability problem)


  • Subject: Re: Packages vs. Finder (perceived stability problem)
  • From: m <email@hidden>
  • Date: Sun, 10 Apr 2005 01:12:49 -0700

To answer my own query: reinvent the wheel. Feh.

In summary: override NSDocument's writeWithBackupToFile:ofType:saveOperation: method to write the package to a temporary directory, then replace the contents of the desired package with that of the temp package.

In pseudo code

if (fullDocumentPath is the same as [self fileName])
{
write document to tempPath (ie call [self writeToFile:tempPath ofType:docType])
remove contents of directory at fullDocumentPath
copy contents of directory at tempPath to fullDocumentPath
delete directory at tempPath
}
else
{
call inherited
}


_murat


On Apr 10, 2005, at 12:46 AM, m wrote:

On Apr 9, 2005, at 7:25 AM, Gregory Weston wrote:

[saving documents that implemented as packages doesn't preserve icon locations]


Consider FSExchangeObjects. I don't know that it will do what you want, but I think it may and it has value otherwise over the technique I think you're using:


<http://developer.apple.com/documentation/Carbon/Reference/ File_Manager/file_manager/chapter_1.2_section_22.html#//apple_ref/ doc/uid/TP30000107-DontLinkChapterID_2-F13080>

It looks like FSExchangeObjects() and its analogs only work on files. Packages (wrappers) are directories so this won't work. :(


Any other ideas?

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Re: Packages vs. Finder (perceived stability problem) (From: Gregory Weston <email@hidden>)
 >Re: Packages vs. Finder (perceived stability problem) (From: m <email@hidden>)

  • Prev by Date: Re: Packages vs. Finder (perceived stability problem)
  • Next by Date: Re: scrolling an NSImageView leaves tracks
  • Previous by thread: Re: Packages vs. Finder (perceived stability problem)
  • Next by thread: selecting images
  • Index(es):
    • Date
    • Thread