On 19 באוק 2015, at 20:13, cocoa-dev-requ...@lists.apple.com wrote:

> I’ve got a weird problem in an OS X app project I’m dusting off after a long 
> hiatus. Every time the app launches, it pops up error alerts saying it can’t 
> open two documents. The underlying problem is that the files for those 
> documents don’t exist (and they have weird paths that are down inside the 
> project’s build directory.) Apparently somehow NSDocumentController is 
> remembering those ancient files as part of the app’s state and is telling my 
> NSDocument class to reopen them on launch.
> 
> I can’t find any way to stop this from happening. My NSDocument subclass 
> correctly returns NO and a file-not-found error from its 
> -readFromURL:ofType:error method, but this doesn’t cause the nonexistent file 
> to be removed from the app’s state.
> 
> - I’ve used ‘defaults delete’ to delete the app’s defaults
> - I’ve deleted the app’s Application Support directory
> - I’ve deleted ~/Library/Saved Application State/my-bundle-id.savedState
> - I’ve deleted ~/Library/Preferences/my-bundle-id.LSSharedFileList.plist
> - I’ve searched ~/Library for any other filename containing the app’s bundle 
> ID but didn’t find any
> - I’ve tried checking the “Launch app without persistent state restoration” 
> checkbox in the scheme’s Options panel
> 
> Where the @&%$ is this stale state being saved? And why won’t it go away even 
> though the file clearly doesn’t exist?
> 
> —Jens
> 

Hi Jens. Is your application by any chance "SandBoxed" ? or is it syncing to 
iCloud? if so - have also a look into the 

~/Library/Containers/my-bundle-id/

It took me some time to get used to find all my app's stuff there.

Motti Shneor.
-- 
If builder built buildings, like programmers write programs,
the first passing woodpecker would destroy the entire civilization.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to