I'm making a simple plain-text editor in Xcode.
Whenever I try to save a document in specific extensions I'll get this error:
I get this alert for certain extensions only (.scala
, .jade
, ...). I have no problem saving a file using most extensions, real or not (.something
, .js
, .stackoverflow
, .html
, ...), or without an extension.
This only happens with Untitled Documents. I can with no problem open the problematic extensions (.scala
, .jade
, ...) and work normally with them.
Any clues as to what might be the issue?
Here are my Document Types, btw:
Edit:
Answering Wil Shipley's questions
Does “scala” or “jade” appear anywhere in your project file? If you create a new file in TextEdit and save it with the “.scala” ending, does it throw the same error? If you double-click on a “.scala” file in the Finder, does it open somewhere?
Not when I posted this question. I've added some code that extracts the extension of the file being opened and tries to find it in a NSDictionary to know what file the user is working with (for automatic syntax highlighting purposes and other things it might be useful for). Nothing that interferes with saving the document however. When I posted this question I don't think 'scala' or 'jade' were typed anywhere on the project.
It doesn't throw the same error, but it won't allow me to save it with that extension right away. Other extensions (I tried '.c', '.jad', '.scal') will save without any dialog popping out. When I try to save with '.jade' or '.scala' this dialog comes out however:
It's worth noting it also comes out when I try to save as '.html'. '.html' however will pose no hassle on my application.
- They will open in Sublime Text. It's the only application I have which can open such documents. I guess it's worth noting also that Finder hides the file extension for these types automatically; something that doesn't happen for made-up extensions like '.scal', '.jad', '.stackoverflow', etc.