Hi all,
Can someone clarify what the deal is with freeing up objects. I am wondering, is this valid:
This type of usage seems to cause an error. But I'm wondering, what about this?
When I've searched for tutorials on this I don't find much via google except spam pages.
Thanks.
Can someone clarify what the deal is with freeing up objects. I am wondering, is this valid:
Code:
NSString *foo = [[NSString alloc] initWithCString: myStr];
[my_label setText: foo];
[foo release];
This type of usage seems to cause an error. But I'm wondering, what about this?
Code:
NSString *foo = [[NSString alloc] initWithCString: myStr];
NSMutableString *moo = [[NSMutableString alloc] initWithString: @"moo"];
[moo appendString: foo];
[foo release];
When I've searched for tutorials on this I don't find much via google except spam pages.
Thanks.
Last edited by a moderator: