Xcode 4.3.2, AS Obj-C, Document Based Problem

So, I run my document based app, choose “new document” from the “File” menu and… nothing happens. Anyone have any suggestions on why that might occur?

Have you defined a document type (Target → Info)? Does its class entry match the name of your NSDocument subclass?

Interesting…

I changed that in my test app and it fixed the problem.

However, doing so in my real app makes the “new” menu item disabled! Putting it back to “NSDocument” makes the menu enabled but brings back the problem of nothing happening. I’m sure I screwed something up trying to figure it out.

Is your class a subclass of NSDocument?

I think so… It starts with this:

script MyDocument
	property parent : class "NSDocument"

I added an application delegate and had some difficulty figuring out how to do it… I’m wondering if I somehow connected something to something that is pointing to somewhere it shouldn’t be…

I hate to do this, but I may be forced to start the build over fresh.

Very interesting discovery this morning. IF you enter a Class Prefix in the “Choose Options for your new project” dialog when creating your project (same dialog you check off “Create Document-Based Application” that automatically fills in all the manual changes that have been discussed in this and other threads…

My xib file and class/applescirpt file both have the appropriate prefix as does the script object in the class file.

It just works. No changes required to get a new document to open after project creation!!!