Int int-objective-c release

Do you need to free int in objective-c? How can we say whether something needs to be freed or not?

+3
source share
2 answers

You should read the following: http://developer.apple.com/mac/library/documentation/cocoa/conceptual/MemoryMgmt/MemoryMgmt.html

You do not need to allocate an integer unless you perform dynamic allocation.

This is more a question C ..

+3
source

double, float, int and char do not need to be freed because they are not allocated dynamically, unless you are doing something like this:

int *toto = new int(1);

;-). (NSString, NSArray ..) ).

, .

+2

Source: https://habr.com/ru/post/1759834/


All Articles