2 ms·
> how do you specify the object on which the outlet should be created? The trick is to set your workspace to assistant mode (the split screen that usually has
by frankus 15y ago
> how do you specify the object on which the outlet should be created?
The trick is to set your workspace to assistant mode (the split screen that usually has the interface on the right and the implementation on the left -- the button with the tux). Then select your .xib file in the project navigator.
The "Counterparts" navigation menu at the top of the right pane should have header files for all of the custom objects instantiated in the nib. Just choose the one you want to add an outlet/action to, and right-drag from the object you want to connect as an outlet (or have trigger an action) over to the interface file.
It will prompt you whether to add an outlet or action (if applicable) and for a name of the outlet or action. It will add the property, synthesize it, add it to dealloc (if you're not using ARC) and free it viewDidUnload (if it's a view controller subclass).