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 7055577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:45:56+00:00 2026-05-28T03:45:56+00:00

What is intended: A button click requests that a CATextLayer object’s string value is

  • 0

What is intended:
A button click requests that a CATextLayer object’s string value is animated until being stopped by another button click request. There are two separate buttons responsible for these actions so that the actions are not confused.

What actually happens:
On the play request, there are several instances when the textLayer’s string is not animated, and its string value remains unchanged, while displaying the assigned “0” (as shown above). In this case, the animation is never initialized and assigned to the CATextLayer object.
However, the error is not consistent. There are also several instances when the CATextLayer object will display the appropriate string values. If continuously clicking the button, the success rate is roughly 70% of seeing the CATextLayer object animate its string value. Are there any scenarios which would bypass the the addAnimation method line of code?

I appreciate any and all of your help with issue. Thanks in advance!

-(IBAction)playText:(id)sender{
    //textLayer object is instantiated elsewhere in the class
    textLayer.frame = CGRectMake(0, 0, 128, 16);
    textLayer.fontSize = 14;
    textLayer.backgroundColor = [UIColor clearColor].CGColor;
    textLayer.foregroundColor = [UIColor yellowColor].CGColor;
    textLayer.string = @"0";
    [self.layer addSubLayer:textLayer];

    CAKeyframeAnimation *textAnimation = [CAKeyframeAnimation animationWithKeyPath:@"string"];
    textAnimation.values = values; 
    textAnimation.repeatCount = HUGE_VALF;
    textAnimation.keyTimes = intervals; 
    textAnimation.calculationMode = kCAAnimationLinear;
    textAnimation.duration = 6;
    [textLayer addAnimation:textAnimation forKey:@"string"];
}

-(IBAction)stopText:(id)sender{
    [textLayer removeAnimationForKey:@"string"];
}
  • 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-05-28T03:45:57+00:00Added an answer on May 28, 2026 at 3:45 am

    The object must be re-initialized for each keyframe animation, in addition to be re-added to it’s parent Sublayer.

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

Sidebar

Related Questions

I've got a button that is intended to scroll down a div when the
I intended for this function to call my MVC action method that returns a
I have a wrapper generic class that intended to be used with a set
What was the intended purpose of the HTML <input type=button> element, taking into account
here's how my scenario is created. I click a button which produces a pdf
I need to make a control with popping out menu and button that causes
I have a div that blocks clicks in another div. It should be possible
I am creating the same button twice: once on Page_Load, and another on: Page_PreRender.
I intended to create a class which only have static members and static functions.
What is the intended use of the optional else clause of the try statement?

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.