开发者

memory management for deeper background work

开发者 https://www.devze.com 2023-03-16 03:11 出处:网络
Currently i do some job in class: [userController startRegistrationForAllObjectsInFutureArrayForTableView:nil];

Currently i do some job in class:

[userController startRegistrationForAllObjectsInFutureArrayForTableView:nil];

this is a function:

-开发者_StackOverflow中文版(void) startRegistrationForAllObjectsInFutureArrayForTableView:(id)tableView;
{
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^(void) {
     ... some job here
});

So, job is going to background. But i still need release class after all job will completed. So what is a way to solve it? Currently i do as here:

    [userController retain];
    [userController startRegistrationForAllObjectsInFutureArrayForTableView:nil];
}
[userController release];
[pool drain], pool = nil;

But i'm not sure if it work correct and what happened when autorelease pool is absent. Tnx

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号