Return array without leak!

[sender of LoadDataComplete: arrDetailData]; I am returning this array, like this, from the objective class C in my class that inherits the ViewController ... if I write [arrDetailData release] below this ... I get a failure ... Please report it ... how to get this array is leak free

+3
source share
3 answers

Why don't you auto-approve it?

+3
source

@devaditya you should use autorelease instead of releasing

[arrDetailData autorelease];

you can write this expression before the statement return.

+2
source

[ relese], , . autorelese. , [array RemoveAllobjects]..

0

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


All Articles