setStringValue problems with dynamically loaded views.
setStringValue problems with dynamically loaded views.
- Subject: setStringValue problems with dynamically loaded views.
- From: Kevin Brock <email@hidden>
- Date: Wed, 17 Mar 2010 14:16:10 -0700
I have some framework code which dynamically loads some views from it's bundle,
based on parameters that are known at runtime.
Calls to setStringValue appear to be having no effect for any of my NSTextFields, either labels or editable.
Here's code that loads a custom view containing a text field from the framework bundle and then sets the text.
@interface MyTextController : NSViewController
{
IBOutlet NSTextField* textField;
}
@end
In the implementation:
- (id)initWithText:(NSString*)field_contents
{
NSBundle* mybundle = [NSBundle bundleWithPath:@"/Library/Frameworks/MyFramework.framework"];
self = [self initWithNibName:@"MyEditText" bundle:mybundle];
if(self)
{
[textField setStringValue:field_contents];
}
return self;
}
The view is loaded successfully, and the text field shows up where it's supposed to in the top level window.
But the text isn't set.
The .xib file shows that File's Owner is the correct subclass of NSViewController, and that the NSTextField control is connected to the textField outlet.
Any ideas?
Kevin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden