Return to Snippet

Revision: 25348
at March 28, 2010 18:48 by pmark


Initial Code
// Give a retained property
@property (retain) UILabel label;


// I believe that the following initializations 
// are equivalent and correct.

/////////////
UILabel *tmpLabel = [[UILabel alloc] init];
self.label = tmpLabel;
[tmpLabel release];

/////////////
self.label = [[[UILabel alloc] init] autorelease];

/////////////
label = [[UILabel alloc] init];

Initial URL


Initial Description


Initial Title
Ways to initialize a retained property

Initial Tags


Initial Language
Objective C