ARC の __block が変数を保持していることを理解しています。これは、次のように、変数が割り当てられる前にブロック内の変数にアクセスするときに使用できます。
__block __weak id observer = [[NSNotificationCenter defaultCenter] addObserverForName:MPMoviePlayerPlaybackDidFinishNotification object:player queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification* notif){
// reference the observer here. observer also retains this block,
// so we'd have a retain cycle unless we either nil out observer here OR
// unless we use __weak in addition to __block. But what does the latter mean?
}];
しかし、これを解析するのに問題があります。オブザーバーがブロックによって保持される場合__block
、効果的に強いと同時に弱いとはどういう意味ですか? ここで何をしているの__weak
ですか?