On 10 Jun 2014, at 04:36, Seth Willits <sli...@araelium.com> wrote:
> My app opens SQL files so I declared a UTI for it in Exported UTIs in the app 
> Info.plist with my own identifier, uses sql as an extension, has a text/plain 
> mime type, and conforms to public.plain-text.
> 
> My app opens a new document window, I edit it, it autosaves, and on relaunch 
> Cocoa yells at me:
> 
> 
> -----
> This application can't reopen autosaved 
> com.panic.coda.structured-query-language-file files.
> 
> -[NSDocumentController 
> reopenDocumentForURL:withContentsOfURL:display:completionHandler:] failed 
> during state restoration. Here's the error:
> Error Domain=NSCocoaErrorDomain Code=256 "The autosaved document “(null)” 
> could not be reopened. " UserInfo=0x608000470540 {NSLocalizedDescription=The 
> autosaved document “(null)” could not be reopened. }
> -----
> 
> 
> I'm a bit puzzled. Guidance? 

 Seems, between Panic and you registering their own UTIs for SQL files, the OS 
gets confused which is the actual type. AFAIK Apple assumes there is only one 
UTI for a type. So when it opens the file, it sees your app can do the 
extension, but when then looking up the UTI to go with that extension, it gives 
you Panic's UTI because it doesn't remember which of the registered UTIs was 
yours. Could that be it? I guess what you could do is try to register for 
Panic's UTI as well (and that of any other app that declares one for SQL 
files), then just internally map them all to your SQL document class?

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de


_______________________________________________

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