Xcode NSString IBOutlet for NSString object in designer?
I have an extended UIView class that has an additional NSString property. For convenience, I would like to somehow set this property in the constructor, if possible.
@property (nonatomic,retain) IBOutlet NSString* designerAccessibleString;
The property will appear as output as expected. I am connecting it to an NSString object that was added from the Object Library (added as a regular object, class changed to NSString). But I can't edit the line through the Attributes Inspector ... is there a way?
I know it is possible to use UILabel, but this is overkill and I don't need bad usability.
Thank.
source to share
I'm afraid you won't be able to change yours NSString
from IB.
If you need a string for the original value, consider the override method
-(id)initWithCoder:(NSCoder*)coder
your controller and manually install NSString
. for example
-(id)initWithCoder:(NSCoder*)coder {
self = [super initWithCoder:coder];
if (self) {
designerAccessibleString = @"somestring";
}
return self;
}
source to share