Yazzmi
Yazzmi

Reputation: 1571

release int in objective-c

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

Answers (2)

Human-Behind
Human-Behind

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

Nyx0uf
Nyx0uf

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

Related Questions