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 protected])
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]