Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My OS X app doesn't want to open files it created

I developed a document-based app that uses Core Data. When I start the app normally by double-clicking on it, it works perfectly and I'm able to create some data files with it. Then I'm closing the app, and trying to open the file I just created through the app, but I get the window that says:

The document "data.hso" couldn't be opened. MyApp cannot open files of this type.

I did modify the plist file to include the Document Types. As a resource I used:

  • http://daemonconstruction.blogspot.com/2012/05/drop-of-file-folder-on-dock-icon.html

  • https://developer.apple.com/library/mac/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-101685

  • Dropping Files onto Dock Icon in Cocoa

I'm really desperate at this moment, cause I really can't think of a reason why it shouldn't work. Any kind of help is highly appreciated!

Here is the snapshot of my plist:

snapshot of plist

like image 848
Eugene Gordin Avatar asked Oct 03 '13 18:10

Eugene Gordin


1 Answers

Maybe your application delegate needs to implement - (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames

like image 133
Smilin Brian Avatar answered Sep 30 '22 10:09

Smilin Brian