• 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
[SOLVED] CAAnimation while modalForApp
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SOLVED] CAAnimation while modalForApp


  • Subject: [SOLVED] CAAnimation while modalForApp
  • From: David LeBer <email@hidden>
  • Date: Wed, 21 Jan 2009 21:00:09 -0500


On 21-Jan-09, at 6:23 PM, David LeBer wrote:

I have a sign in window that implements a simple CAKeyframeAnimation to perform a shake if the sign in fails using the NSWindow's animator proxy object.

i.e.

[self setAnimations:[NSDictionary dictionaryWithObject:[self shakeAnimationWithNumber:4 duration:0.5f vigour:0.03f] forKey:@"frameOrigin"]];
[[self animator] setFrameOrigin:[self frame].origin];


However, I need to make the app modal for that window, and when I do the animation doesn't fire (or isn't visible).

Anyone have any idea of what I should be looking for in the documentation to explain this? Is there some kind of run-loop mode dependency I am not aware of?

To answer my own question. I took a WAG that this was run-loop issue and tried this hint:


<http://www.dejal.com/blog/2007/01/cocoa-topics-case-modal-webview>

I switched the opening of the window from runModalForWindow: to beginModalSessionForWindow: + runModalSession with a tickle of [[NSRunLoop currentRunLoop] limitDateForMode:NSDefaultRunLoopMode] each time through the loop.

The shake animation now happens as expected. I have no idea whether there is a different/better way of handling this but it is working now.

;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site: 	http://codeferous.com
blog: 	http://davidleber.net
profile:	http://www.linkedin.com/in/davidleber
twitter:	http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org




_______________________________________________

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


References: 
 >CAAnimation while modalForApp (From: David LeBer <email@hidden>)

  • Prev by Date: Re: NSView behaves different on 10.4 vs 10.5?
  • Next by Date: Re: NSScroller buttons not scrolling?
  • Previous by thread: CAAnimation while modalForApp
  • Next by thread: NSScroller buttons not scrolling?
  • Index(es):
    • Date
    • Thread