Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9180189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:59:05+00:00 2026-06-17T17:59:05+00:00

I have some NSView subclass that I’m animating (changing frame and alpha value). Sometimes

  • 0

I have some NSView subclass that I’m animating (changing frame and alpha value). Sometimes I would need to stop the animation, however I’m keep getting error

Here is a code:

[NSAnimationContext beginGrouping];
[[NSAnimationContext currentContext] setDuration:1.5f];
[textView.animator setFrame:frame];
[textView.animator setAlphaValue:0.0];
[NSAnimationContext endGrouping];

if ([textView.animator isAnimating]) { // Here the exception is raised
    NSLog(@"%@ is animating!", textView);
}

I am trying to call [textView.animator isAnimating] but that just gives me

Exception detected while handling key input.
*** -[NSProxy doesNotRecognizeSelector:isAnimating] called!

Example project with the code is at https://bitbucket.org/lukaszb/animationartifacts/src/0dc41660f26dd3b629c28bbbda6eb647

I could probably add some isAnimating property to my NSView subclass and set it at animation start and at the completion handler, however that could also lead to some race condition issue I suppose.

Could anyone help me how to detect if a view is being animated?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:59:06+00:00Added an answer on June 17, 2026 at 5:59 pm

    Neither NSView nor its animator have a property animating, so you cannot just query that value.

    However, as you suggest, you can define your own property for that purpose. The trick is to set it back to NO once the animation is done, which you can do using the completionHandler property on the current animation context:

    [NSAnimationContext beginGrouping];
    [NSAnimationContext currentContext].completionHandler = ^{ self.animating = NO; };
    // ... set up your animation ...
    [NSAnimationContext endGrouping];
    

    Note that the block is called on the main thread (as indicated in the documentation), so it will ensure that the state is consistent as long as you always set the animating property on the main thread. Since you are dealing with UI code, that is probably the case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to use a custom NSView subclass to draw some content, but it
Have some div elements on a page that I need to hide by default
I have some data loaded as a np.ndarray and need to convert it to
I have some arbitrary pixel data that I want to save as a PNG.
I have some text lines like that : vt_wildshade2^508^508 vt_ailleurs2^1188^1188 ... vt_high2^13652^13652 Is it
I have some code that will change the background color of a specific label
i have some problems with a Query seem IN dosen't work with Group_concat, that
I have some code here that uses bitsets to store many 1 bit values
Have some dates in my local Oracle 11g database that are in this format:
I am writing a simple MacRuby app. I have an NSView that draws an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.