Re: Lost memory, GCD, dispatch sources, Cocoa bindings & User interface
Re: Lost memory, GCD, dispatch sources, Cocoa bindings & User interface
- Subject: Re: Lost memory, GCD, dispatch sources, Cocoa bindings & User interface
- From: Jean Suisse <email@hidden>
- Date: Thu, 17 Sep 2015 13:10:08 +0200
Thanks for your reply.
>
> I don't see why you're using a strong reference from the weak reference inside your timer. You may be confusing ARC with that and your etc code. Change your code to just use weakself rather than strongself when calling updateUI. If there's a strong reference needed, try using self only. Also, is it possible your function never ends? Check your etc code there.
I read about it in the section "Use Lifetime Qualifiers to Avoid Strong Reference Cycles” of the "Transitioning to ARC Release Notes” :
MyViewController *myController = [[MyViewController alloc] init…];
// ...
MyViewController * __weak weakMyController = myController;
myController.completionHandler = ^(NSInteger result) {
MyViewController *strongMyController = weakMyController;
if (strongMyController) {
// ...
[strongMyController dismissViewControllerAnimated:YES completion:nil];
// ...
}
else {
// Probably nothing...
}
};
and decided to go with it.
That said, I do not really need that much in my app, because I know for a fact that self will live as long as the app runs. So I could go with weak only or even with __unsafe_unretained.
I tried. It does not change anything.
The “etc” only describes identical lines repeated. There isn’t anything more.
_______________________________________________
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
- Prev by Date:
Re: Lost memory, GCD, dispatch sources, ?Cocoa bindings & User interface
- Next by Date:
Re: Lost memory, GCD, dispatch sources, Cocoa bindings & User interface
- Previous by thread:
Re: Lost memory, GCD, dispatch sources, Cocoa bindings & User interface
- Next by thread:
Re: Lost memory, GCD, dispatch sources, Cocoa bindings & User interface
- Index(es):