• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Lost memory, GCD, dispatch sources, Cocoa bindings & User interface
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Lost memory, GCD, dispatch sources, Cocoa bindings & User interface (From: Jean Suisse <email@hidden>)
 >Re: Lost memory, GCD, dispatch sources, Cocoa bindings & User interface (From: "Gary L. Wade" <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):
    • Date
    • Thread