Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

printz

macrumors regular
Original poster
Dec 23, 2012
218
0
I'm trying to give some extra data to some controls I'm putting in a dialog box. However, the "User Defined Runtime Attributes" entry from the Identity Inspector of Xcode XIB editor requires the class to have those properties defined. First, I tried creating categories for those controls, but Interface Builder (and the program in general) doesn't detect the new properties defined in the categories. Then, I subclassed the control classes (in this case, NSTextField and NSButton), the program started properly, but the controls looked all glitchy and broken and nothing worked.

So, what's the best way to give custom attributes to controls? Is there a property I'm missing? I know there's the "identifier" property, but I don't want my custom attributes to be unique per control. Probably best for this purpose would be a dictionary, so I can use as many attributes as I wish.

EDIT: is it okay if I click on the contained cells (NSCell-based) and set representedObject?
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.