Skip to content

Instantly share code, notes, and snippets.

@ejknapp
Created May 27, 2010 19:47
Show Gist options
  • Select an option

  • Save ejknapp/416260 to your computer and use it in GitHub Desktop.

Select an option

Save ejknapp/416260 to your computer and use it in GitHub Desktop.
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