If I have a property like this:
@property (nonatomic, retain) UILabel* lblUsername;
Should I in viewDidLoad
do this:
self.lblUsername = [[[UILabel alloc] init...] autorelease]; self.lblUsername.text = @"A label"; self.lblUsername....
Or should I do this:
UILabel* usernameLabel = [[UILabel alloc] init...]; usernameLabel.text = @"A label"; usernameLabel.... self.lblUsername = usernameLabel; [usernameLabel release];
I have seen both, and I'm not sure what I should use, any advantages of using one over the other? (I know that both are "correct" in the syntax and both work, but which is preferable?)
source share