Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Associate file type/extension to non document based cocoa application

This is for some reason really hard to find and solve. Cannot find any documentation on it. I've got a non-document based application which I would like to open all specific file types, but I do not want to use NSDocuments but let my code handle the opening of file and processing of it. I've added the CFBundleTypeExtensions and all, settings to the info.plist.

Now the application will open the filetype but display an error like: "The document xxxx could not be opened. Application cannot open files in the yyyyy format."

like image 623
Ger Teunis Avatar asked Jan 07 '10 15:01

Ger Teunis


1 Answers

Have you implemented -application:openFile: in an app delegate? If not, your application has no way of knowing how to open some random file in some random format. It's up to you to add that functionality and respond with success or failure.

like image 55
Joshua Nozzi Avatar answered Nov 12 '22 19:11

Joshua Nozzi