Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

knightlie

macrumors 6502a
Original poster
Feb 18, 2008
546
0
I have a Core Data document-based application which is all working correctly. I'd like to implement a "New Document wizard" which appears as a sheet after the user has created a new document - the wizard will ask some questions and populate aspects of the document with the users choices. The wizard is displayed by a method of the document controller class.

I've tried calling the method in a number of places but none of them seem to work. Placing the call in awakeFromNib or windowControllerDidLoadNib: causes an infinite loop.

Does anyone have an idea of the best method to place this call in? I guess I'm looking for some kind of "document has finished being created" method to override, or notification to observe.

Thanks in advance.
 
Does anyone have an idea of the best method to place this call in? I guess I'm looking for some kind of "document has finished being created" method to override, or notification to observe.

Yes, that is what you need to overwrite. The method that is called only when a new Document is created (and not when an existing one is opened) is
Code:
- initWithType:error:
See the documentation.

You should also have a look at the basic guide for document based applications, I found it quite useful.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.