Reputation: 1571
do you need to release int in objective-c? How can we tell if something needs to be released or not?
Upvotes: 3
Views: 1795
Reputation: 98
double, float, int and char do not need to be release cause they are not allocated dynamically, except if you do something like this :
int *toto = new int(1);
You will need to release your integer ;-) . However all object need to be released (NSString, NSArray etc... have to be released).
Hope it will help you.
Upvotes: 2
Reputation: 4649
You should read this : http://developer.apple.com/mac/library/documentation/cocoa/conceptual/MemoryMgmt/MemoryMgmt.html
You don't need to release an integer if you didn't do a dynamic allocation.
It's more A C question..
Upvotes: 3