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

NeonKingKong

macrumors member
Original poster
Nov 14, 2008
69
7
Portland, OR
I have a refreshDisplay: method that calls the setString: method of an NSTextView. I can save, and load, but when I load even though my program loads the data, it does not display it on the NSTextView as it should. I did a check and that NSTextView seems to be nil when I load, which is why the setString: method does not do anything to it. I thought this textView would be initialized by interface builder. Any suggestions? Thanks.
 
Most likely you're trying to access the text view before the nib is loaded, for example in an init method. Try moving it to awakeFromNib.
 
Thanks, you were right. It's not nil anymore! :)

Unfortunately, even though my load methods are getting called and temporarily stored and displayed through NSLog, the initializer on my data managing class getting called resets them to new objects, dumping that information I want to keep.

So I will have to figure out a way to use these objects I'm and have my pointers in my application point to those instead of creating new ones in the init method.

Most likely you're trying to access the text view before the nib is loaded, for example in an init method. Try moving it to awakeFromNib.


Actually I called my refreshDisplay method in the awakeFromNib method, and now it says that interfaceBuilder-instantiated object is nil. ?

Most likely you're trying to access the text view before the nib is loaded, for example in an init method. Try moving it to awakeFromNib.


Ok this is strange... the init method of the object I archived, and am now loading, is being called when I load the saved file. It shouldn't be called, because I want to unarchived the frozen one. Why is it doing this?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.