-[UIView actionForLayer:forKey:] returns NSNull
-[UIView actionForLayer:forKey:] returns NSNull
- Subject: -[UIView actionForLayer:forKey:] returns NSNull
- From: BJ Homer <email@hidden>
- Date: Tue, 3 Mar 2009 10:15:43 -0700
I have a UIWebView displaying the contents of a local html file. When the
user presses a button, I'd like to transition, with a fade, to another
UIWebView (also displaying local content; no need to wait for the network.)
The UIView transitions will not do a fade, but a CATransition on a CALayer
would do the trick. Of course, I'd need to apply to the CATransition to a
layer containing both of the webViews, but that's fine; the UIWebViews are
both subviews of another UIView that serves simply to contain both of them.
As I understand, when a subview is added to a view, the layer calls
-[CALayer actionForKey:], which goes through the following search (self
refers to the CALayer on which actionForKey: was called):
1. [self.delegate actionForLayer:forKey:]
2. [self.actions valueForKey:]
3. Recursively search self.style for an actions dictionary, then [actions
valueForKey:]
4. [self defaultActionForKey:]
If any of these steps returns a non-nil result, that value is used.
Especially relevant in this case is the fact that when an NSNull is
returned, the search stops and nil is returned from [CALayer actionForKey:].
The problem is that, as near as I can tell, UIView's implementation of
actionForLayer:forKey: returns an NSNull. I would have liked to add a
CATransition to the container view's layer's action dictionary
(view.layer.actions) for the key kCAOnOrderIn. However, since UIView's
actionForLayer:forKey: returns NSNull, the search always bails out after the
first step. This seems odd, since it seems that defaultActionForKey: never
actually gets the chance to return a default action unless you're already
changing things.
Am I missing something here, or is a UIView's layer's actions dictionary
only usable if you're subclassing UIView?
-BJ Homer
_______________________________________________
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