Created
May 27, 2010 19:47
-
-
Save ejknapp/416260 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 to create an outlet with a class I wrote. | |
| Example for SomeShinyClass | |
| In the .h file: | |
| 1. @class SomeShinyClass; | |
| 2. Instance variable | |
| • SomeShinyClass *someShiny; | |
| 3. Property declaration. | |
| • @property (nonatomic, retain) IBOutlet | |
| SomeShinyClass *someShiny; | |
| In the .m file: | |
| 1. Import the .h of the class. | |
| • #import "SomeShinyClass.h" | |
| 2. Synthesize the get/set methods. | |
| • @synthesize someShiny; | |
| 3. Assert that the pointer is not null in the viewDidLoad method. | |
| • assert(someShiny != nil); | |
| 4. Release the pointer in the dealloc method. | |
| • [someShiny release]; | |
| In Interface Builder | |
| 1. Wire the outlets to the object. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment