On Mon, 9 Jul 2012 11:03:50 -0500, Fritz Anderson said: >You correctly describe the cycle. In practice, NSOperationQueue probably >releases the block when it's done with it, and breaks the cycle, but >clang can't know that, so it has to warn of the "likely" cycle. > >You can break this by having a strong reference to self that the block >can manage independently. > > __block MyClass * blockSelf = self; > [self.operationQueue addOperationWithBlock:^{ > [blockSelf bar]; > blockSelf = nil; > }];
A contortion I guess those of us switching from GC to ARC will have to sprinkle around. :( Shame. -- ____________________________________________________________ Sean McBride, B. Eng s...@rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montréal, Québec, Canada _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com