Hello. Why is it:
and that *title
did not have to alloc/init
while *newText
did?
Code:
@synthesize statusText;
- (IBAction) buttonPressed: (id) sender {
NSString *title = [sender titleForState:UIControlStateNormal];
NSString *newText = [[NSString alloc] initWithFormat: @"%@ button pressed.", title];
statusText.text = newText;
[newText release];
}
and that *title
Code:
NSString *title = [sender titleForState:UIControlStateNormal];
did not have to alloc/init
while *newText
Code:
NSString *newText = [[NSString alloc] initWithFormat: @"%@ button pressed.", title];