• 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
-[UIView actionForLayer:forKey:] returns NSNull
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

-[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

  • Follow-Ups:
    • Re: -[UIView actionForLayer:forKey:] returns NSNull
      • From: David Duncan <email@hidden>
  • Prev by Date: Re: How to create a simple pop-up-menu
  • Next by Date: Re: Problem when i connect "Add" button to NSArrayController
  • Previous by thread: Re: NSDocumentController Problem
  • Next by thread: Re: -[UIView actionForLayer:forKey:] returns NSNull
  • Index(es):
    • Date
    • Thread