Created
June 15, 2010 18:09
-
-
Save ejknapp/439446 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Steps for making Outlets (in Xcode 3!) | |
| 1. Open the view controller .h file. (In Class group.) | |
| 2. Add a property | |
| 1. Make an instance variable of UILabel type. | |
| UILabel *myLabel; | |
| 2. Make a property for the ivar. | |
| 3. Make property an IBOutlet | |
| @property (nonatomic, retain) IBOutlet UILabel *myLabel; | |
| 4. Switch to .m file of controller. | |
| 5. Synthesize the property. | |
| @synthesize myLabel; | |
| 6. Release the pointer to ivar. | |
| 1. Go to dealloc method. | |
| 2. Put release before [super dealloc]. | |
| [myLabel release]; | |
| 3. Save .h and .m files. | |
| 4. Open "Resources" group. | |
| 5. Double-click on view controller .xib file. This will launch | |
| Interface Builder. | |
| 6. Make the "View" window active. | |
| 7. Select the Tools->Library menu item if needed. | |
| 8. Click on "Classes" tab of Library window. | |
| 9. In the bottom search entry field enter "label". | |
| 10. Drag a UILabel to the view and adjust as needed. | |
| 11. Click on nib file window and select "File's Owner". | |
| 12. Select Tools->Inspector menu item. Click on Connections tab (2nd tab). | |
| 13. Click and drag from the little circle to the right of the outlet to the label on the View and let go. | |
| 14. Save the nib file. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment