• 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: Changing Subview Order Prevents Dragging
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing Subview Order Prevents Dragging


  • Subject: Re: Changing Subview Order Prevents Dragging
  • From: Graham Cox <email@hidden>
  • Date: Tue, 14 May 2013 13:34:40 +1000

On 14/05/2013, at 1:14 PM, Roland King <email@hidden> wrote:

> That depends on whether the framework which is calling mouseUp:/mouseDown: retains the object on which it's calling it. If the framework is using ARC and a normal strong reference, then it would be retained and that would stop it deallocing, if it's not using ARC then it depends on whether the framework retains the view explicitly, which it probably should since it's trying to use it but I have no idea whether it does or not.

I'm pretty sure it doesn't, at least between the mouseDown and mouseDragged phases - it may for repeated calls to mouseDragged. I have run into this exact issue in the past.


> Not too hard to test, stick a breakpoint in the dealloc() method and see if it's called from within one of the mouseUp:/mouseDown: methods.
>
> If you are losing it, you can assign self to a strong reference at the start of the method which you nil out again after you've done your window shuffle, and that will hang onto it (as long as it doesn't get optimized out).

Or just do it manually. It's not incompatible with ARC which after all simply inserts the same calls. To my mind, it's clearer what's going on than relying on all those arcane magic pointer types.

--Graham


_______________________________________________

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

  • Follow-Ups:
    • Re: Changing Subview Order Prevents Dragging
      • From: Roland King <email@hidden>
References: 
 >Changing Subview Order Prevents Dragging (From: Thomas Wetmore <email@hidden>)
 >Re: Changing Subview Order Prevents Dragging (From: Graham Cox <email@hidden>)
 >Re: Changing Subview Order Prevents Dragging (From: Roland King <email@hidden>)

  • Prev by Date: Re: Changing Subview Order Prevents Dragging
  • Next by Date: Re: Changing Subview Order Prevents Dragging
  • Previous by thread: Re: Changing Subview Order Prevents Dragging
  • Next by thread: Re: Changing Subview Order Prevents Dragging
  • Index(es):
    • Date
    • Thread