iOS判断是否为退出当前界面来销毁某强引用量

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

//首先判断当前栈是否大于0

if (!((int)self.navigationController.viewControllers.count  > 0 )) {

dispatch_async(dispatch_get_main_queue(), ^{

//销毁强引用量

});

}else{

for (int i = (int)self.navigationController.viewControllers.count - 1 ; i >= 0; i--) {

if ([self.navigationController.viewControllers objectAtIndex:i] == self) {

break;

}

if(i == 0 ){

dispatch_async(dispatch_get_main_queue(), ^{

//销毁强引用量

});

}

}

}

});

你可能感兴趣的:(iOS判断是否为退出当前界面来销毁某强引用量)