Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 30, 2012, 04:34 AM   #1
knightlie
macrumors 6502a
 
Join Date: Feb 2008
Document App: Triggering Behaviour After a New Document

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.
knightlie is offline   0 Reply With Quote
Old Apr 30, 2012, 11:00 AM   #2
thundersteele
macrumors 68030
 
Join Date: Oct 2011
Quote:
Originally Posted by knightlie View Post
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.
thundersteele is offline   0 Reply With Quote
Old Apr 30, 2012, 11:26 AM   #3
knightlie
Thread Starter
macrumors 6502a
 
Join Date: Feb 2008
Great, that's perfect, thanks.
knightlie is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Tags
core data, document

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Document Manager - An Awesome App For Document Management wajhik iPhone and iPod touch Apps 0 May 3, 2013 05:08 AM

Forum Jump

All times are GMT -5. The time now is 09:08 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC