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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:40:42+00:00 2026-05-23T12:40:42+00:00

Can I ever run into block retain cycle with animateWithDuration:animations:completion: ? If yes, then

  • 0

Can I ever run into block retain cycle with animateWithDuration:animations:completion:? If yes, then could you please show me some example?

Also I couldn’t find in Apple doc that completion: block is copied to the heap. Can I assume that unless explicitly specified (like in addObserverForName:object:queue:usingBlock:) the block is NOT copied to the heap?

  • 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-23T12:40:42+00:00Added an answer on May 23, 2026 at 12:40 pm

    There is no such thing as a block that is “copied to the stack”. All blocks start on the stack; copying moves them to the heap. The block must be copied because it is called after your method returns (unless you do not animate anything or specify zero delay; in that case, the completion block seems to be called immediately).

    There might be a case where you get a retain cycle: You have an infinitely-repeating animation and you pop the view controller, causing the view to lose its superview. In this case, I’d expect the animation to be cancelled instead of continuing indefinitely. This is not difficult to test.

    Note that if the animation is cancelled, it presumably is also cancelled if you switch away from and back to a tab, or push a VC on top and then pop it.

    I’d also try testing with a large duration/repeat count, in case UIKit special-cases infinitely-repeating animations to ignore the completion block (but I’m not sure it can do that, since I think the completion block has to be called if the animation is “interrupted” by setting one of the animated properties).

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

Sidebar

Related Questions

I have a textfield where the user can type what ever he want into
I can't really ever think of a time when I would use git merge
Not ever sure if it can be done, but is it possible to use
Is there a way I can change attributes on a model without ever firing
I feel like I've only ever seen this here on SO, but I can't
So, I've run into a problem with PHP's rawurlencode function. All text fields in
I'm implementing some custom serialization (to byte array), and have run into a problem
I've run into a strange problem while writing some code for my personal use.
I'm learning Javascript and CSS and have run into an issue where my CSS
I'm implementing an FRP framework in Scala and I seem to have run into

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.