|Jun 30, 2008, 10:10 AM||#1|
Hi, I can't figure out this.
I have MyDocument class which inherits from NSDocument and DocView which intherits from NSView. DocView has IBOutlet to MyDocument. When I working inside DocView and I want to get some information from my MyDocument object, I get "null".
In Interfeice Builder there is connection from CustomView (DocView) to File's Ower (MyDocument).
|Jun 30, 2008, 10:40 AM||#2|
I believe the nib loader first fully initializes all custom view objects archived in a nib before setting their outlets and other instance variables.
This would mean that your custom view doesn't yet have its outlet to MyDocument set inside its initializer. Which is where you are trying to use it, thus resulting in NULL.
Note, this should only be happening with custom views. Other objects are already initialized before ever being archived into the nib.
I may be wrong though.
Last edited by yoavcs; Jun 30, 2008 at 10:56 AM.
|Jun 30, 2008, 11:45 AM||#3|
I am going to check that a bit later and write if it's true. This should mentioned somewhere in documentation, I will try to find it.
Found that: http://developer.apple.com/documenta...inkElementID_7
So it works as you said. Thanks.
Last edited by davidlt; Jun 30, 2008 at 12:20 PM.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|basic core data saving in a document-based app||Yashman!||Mac Programming||0||Apr 10, 2014 08:58 AM|
|Document based application, use folders (of any type) as documents||printz||Mac Programming||0||Oct 30, 2013 02:02 PM|
|How do I automatically create and populate folders based on document names||auslegung||Mac Basics and Help||4||Feb 17, 2013 07:14 PM|
|Threading of Core Data in a document based application||bitdoctor||Mac Programming||0||Sep 25, 2012 02:30 AM|
|Package-based document trouble||Starfox||Mac Programming||1||Jun 7, 2012 03:59 AM|
All times are GMT -5. The time now is 02:27 PM.