ARC and blocks
ARC and blocks
- Subject: ARC and blocks
- From: "Jan E. Schotsman" <email@hidden>
- Date: Thu, 26 Jan 2012 22:51:30 +0100
Hello,
This code is given in the "Transitioning to ARC Release Notes" as an
example of accomodating blocks in an ARC environment:
__block MyViewController *myController = [[MyViewController alloc]
init…];
// ...
myController.completionHandler = ^(NSInteger result) {
[myController dismissViewControllerAnimated:YES completion:nil];
myController = nil;
};
Supposedly this avoids a retain cycle. But where is the cycle? At
least two objects are needed for a cycle. What is the second one?
Excuse me if I'm being dumb.
Jan E.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden