Re: who stole my UIView?
Re: who stole my UIView?
- Subject: Re: who stole my UIView?
- From: glenn andreas <email@hidden>
- Date: Thu, 12 Aug 2010 18:38:16 -0500
On Aug 12, 2010, at 6:28 PM, Matt Neuburg wrote:
> Here's my code, simplified (and tested in this simple form) in order to
> demonstrate a mystery:
>
> - (void) illuminate: (NSArray*) arr {
> UIView* v = [[UIView alloc] initWithFrame:self.view.bounds];
> NSLog(@"%@", v);
> CALayer* lay = [v layer];
> v.tag = 111;
> [self.view addSubview:v];
> lay.delegate = self; // <-- ***
Don't do that.
From <https://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIView_Class/UIView/UIView.html#//apple_ref/doc/uid/TP40006816-CH3-SW31>
Warning: Since the view is the layer’s delegate, you should never set the view as a delegate of another CALayerobject. Additionally, you should never change the delegate of this layer.
Basically you're break the underlying plumbing, connecting the cold water to the electrical, and wondering why your water tastes tingly...
Glenn Andreas email@hidden
The most merciful thing in the world ... is the inability of the human mind to correlate all its contents - HPL
_______________________________________________
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