【发布时间】:2013-01-11 11:18:13
【问题描述】:
如何避免在 xcode 中出现此警告。这是代码sn-p:
[player(AVPlayer object) addPeriodicTimeObserverForInterval:CMTimeMakeWithSeconds(0.1, 100)
queue:nil usingBlock:^(CMTime time) {
current+=1;
if(current==60)
{
min+=(current/60);
current = 0;
}
[timerDisp(UILabel) setText:[NSString stringWithFormat:@"%02d:%02d",min,current]];///warning occurs in this line
}];
【问题讨论】:
-
timerDisp是类的属性吗? -
是的,@property(nonatomic,strong)UILabel *timerDisp;
-
这是什么:
player(AVPlayer object)和timerDisp(UILabel)? -
AVPlayer *player; UILabel *timerDisp;
-
真正的问题是当你知道循环引用将被破坏时(例如,如果你总是清除引用当网络请求完成时)。
标签: objective-c cocoa-touch automatic-ref-counting avplayer retain