"Breaks" is a subjective description (thus the quotes) for what I experienced, 
but from my perspective it is accurate.  Here's what happened.  I had a custom 
subclass of NSView and I setup it up (in code) to be layer-backed with a 
CATransition for the "subviews" key (i.e. fade in/out animation for changes to 
the subviews).  All is well.

Changed this custom subclass to descend from NSBox (instead of NSView) so I 
could take advantage of the selection-highlighting-within-a-Collection-View 
trick demonstrated in the "IconCollection" (Apple-provided) sample project 
(take an NSBox with a fill color and bind its transparent property to the 
"selected" property of its associated NSCollectionViewItem).

A day or so later I notice that my fade in/out animation is gone.  Eventually 
track this regression down to the change from NSView-subclass to NSBox-subclass.

Should I be surprised by this difference in behavior between NSView and NSBox?  
I have been setting up my animation via:

        [self setWantsLayer:YES];
        [self setAnimations:[NSDictionary dictionaryWithObject:transition 
forKey:@"subviews"]];

and then expecting animation to occur when executing this:

        [[self animator] replaceSubview:mThumbnailStandin with:mThumbnail];

perhaps there is some other way to install/provide my animation that NSBox will 
respect?

Any ideas?  I realize there is the straightforward approach of staying with an 
NSView sub-class and doing my own binding-friendly fill color.

Thanks in advance.

Mark Sanvitale

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to