views:

87

answers:

1

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.

A: 

Is the text view marked as an IBOutlet in your class's interface, and are you sure it is properly connected to the appropriate object in your nib? If it is, then there should be no reason for your NSTextField ivar to be nil.

dreamlax
First half of comment:yes it is an IBOutlet. It is not nil when I create a new document (i can call its setString: method), but when I load, nothing is displayed, even though NSLog() shows the program loaded the data by displaying it. When I hit the button that creates new "hypothetical data objects" things are displayed, and my NSLog() says the textView is not nil. But the data is new data, not the loaded one.
Finley Still
Second Half of comment: The NSTextView (not field) is only nil right after a load. So I must be doing something wrong in my - (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError- (id)initWithCoder:(NSCoder *)decodermethods. Right?
Finley Still
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?
Finley Still