retain

@property definitions with ARC: strong or retain?

陌路散爱 提交于 2019-11-26 07:27:05
问题 Using Xcode 4.2 and ARC, I notice that the auto-generated code for an NSManagedObject still reads like this for properties: @property (nonatomic, retain) NSString * someString; 1) Shouldn\'t retain now be replace with strong or weak ? 2) Why does the auto-generated code still use retain 3) What is the correct replacement for retain in this property statement? I\'m currently debugging a problem using NSFetchRequest , and I thought this might be the source of the problem. Thoughts? 回答1: 1)

capturing self strongly in this block is likely to lead to a retain cycle

怎甘沉沦 提交于 2019-11-26 06:11:21
问题 How can I avoid this warning in xcode. Here is the code snippet: [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 }]; 回答1: The capture of self here is coming in with your implicit property access of self.timerDisp - you can't refer to