What does “release” mean in this situation on the iPhone?

I want to ask a stupid question about the iPhone app. I am a green iPhone application. I read the following code on the Apple website.

    MyViewController *aViewController = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:[NSBundle mainBundle]];
    [self setMyViewController:aViewController];
    [aViewController release];

And I have a question, how does this mean “release” on line 3?

Does this mean memory? or does the program manage this object? or other meanings. Thank you very much.

+3
source share
2 answers

alloc -, , , 1 - , -, . retain , , 2 . 0, , . , release .

aViewController alloc 'd, , 1 +1.

2. , retain .

3, , release . - , .

+5

, alloc, , release, , .

. , retain, , retain . , . ( , ). , , .

, alloc , .

+2

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


All Articles