I was using an NSBox for my convenience to make view swapping easy.  The super 
view has two boxes (dstBox is one of them) and there are three different views 
that get swapped into and out of the bottom box.  Using an NSBox makes this 
pretty easy.  That's why it's designed that way.

 
On Apr 1, 2013, at 1:30 PM, Fritz Anderson <[email protected]> wrote:

> On 1 Apr 2013, at 11:11 AM, Brad Stone <[email protected]> wrote:
> 
>> Desired action: 
>> 1) An NSBox (dstBox) with View A in it's content animates out to the left
>> 2) NSBox's content is replaced with View B
>> 3) NSBox with View B in it's content animates in from the right. 
>> 
>> Actual action:
>> 1) An NSBox (dstBox) with View A in it's content animates out to the left
>> 2) NSBox with View A in it's content animates in from the right. 
>> 3) NSBox's content is replaced with View B
>> 
>> 2 and 3 are swapped which is the problem.
>> 
>> The motion of the animation works fine.   The problem is the NSBox's content 
>>  (dstBox) doesn't change on the screen until the animation is stopped.  I'd 
>> like it to be switched somewhere off screen so view B comes in from the 
>> right and the user doesn't see the switch happen.
>> 
>> Does someone have any suggestions I can try out?
> 
> It is possible that during a single animation, a view's contents are reduced 
> to an OpenGL texture, and won't update until the animation completes. Or this 
> is an effect of the animationBlockingMode you've chosen.
> 
> You have two completely different instances of visible content. There's no 
> reason to be stingy. Use two views. Initialize both before use, and track 
> which is current. The performance hit is small, and is complete before the 
> views are visible; barring a pathological case, the memory hit is negligible 
> on a modern computer. (You may be able to remove the (instance?) variable 
> toRight, which you'd otherwise have to keep in sync, and replace it with 
> _activeBox == _rightBox.)
> 
> (I'm curious: Do you need the decoration of an NSBox? Would an NSView do as 
> well?)
> 
>       — F
> 
> -- 
> Fritz Anderson
> Xcode 4 Unleashed: 4.5 supplement for free!
> http://www.informit.com/store/xcode-4-unleashed-9780672333279
> 


_______________________________________________

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

This email sent to [email protected]

Reply via email to