On 14/05/2013, at 12:27 PM, Thomas Wetmore <t...@verizon.net> wrote:

> Can anyone suggest why adding the three lines in mouseDown prevents dragging? 
> Using ARC.


When you call -removeFromSuperview, the view is deleted, as there are no more 
references to it. The other methods are not called because the object ceases to 
exist.

You need to retain it, remove it, add it to the superview then release it. ARC 
won't automatically help you out in this case because you're deallocing self, 
indirectly, which is not a good idea.

[self retain];
[self removeFromSuperview];
[superview addSubview:self];
[self release];


--Graham


_______________________________________________

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

Reply via email to