1
votes

I just created a document-based OSX app with a core data support in it. There were 3 document types already pre set in its plist

enter image description here

However, when I double click on xml file to open it through my app it shows me this window

enter image description here

Does anyone know where my problem might be?!

EDIT for clarification:

Since this document type are already in the plist, I'm assuming that the default document based application can open them without additional modifications in code. However, when double clicking files of this type, (or dragging them into the application icon in the doc) the above error pops up.

It doesn't appear that provided document extensions don't work in a document based application, so what do I need to do to fix it?

1
Nobody knows. No. 1, you don't say what kind of application you have. Thus, one wonders why you need to use the XML file type? No. 2, you don't bother to post your code for reading the file. Thus, one wonders "What the heck do I know? I'm not a psychic." - El Tomato
thank you for friendly useful constructive comment - Eugene Gordin
@TBlue he states it is an OSX Document Based application. Presumably from the template provided by XCode. - terphi
You shouldn't need to implement application:openFiles: in a document-based app, and making a document the application's delegate makes no sense. Please edit your question to include your readFrom(Data|URL):ofType:error: method (even if it is the one the template gave you). - Peter Hosey
Yeah, thank you Peter, I actually figured it out - Eugene Gordin

1 Answers

0
votes

Peter Hosey's answer is correct, I had to implement readFromURL:ofType:error: method to make everything to work.