Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcode NSString IBOutlet to NSString Object in designer?

I have a UIView extended class which has an extra NSString property. For convenience I'd like to somehow set that property in the designer, if possible.

@property (nonatomic,retain) IBOutlet NSString* designerAccessibleString;

The property will show up as an Outlet as expected. I connect it to an NSString Object that was added from the Objects Library (added as Plain Object, class changed to NSString). But I'm unable to edit the string through the designer Attributes Inspector... is there a way?

I know it's possible to use a UILabel, but that's overkill and I don't need the convenience that badly.

Thanks.

like image 203
Ivan Dossev Avatar asked Nov 22 '25 12:11

Ivan Dossev


1 Answers

You can do this using the User Defined Runtime Attributes section of the identity inspector:

User Defined Runtime Attributes in XCode 5

In this example the initialRelativeUrl property is set when the view controller loads.

like image 155
Ian Newson Avatar answered Nov 24 '25 02:11

Ian Newson