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

In a discussion with co-workers today, I lamented that I can't ever remember what
In Java, can Class.forName ever return null, or will it always throw a ClassNotFoundException
How can I search if a file named foo.txt was ever committed to my
What are the problems that calling this method can help with? Do you ever
Can you cast a List<int> to List<string> somehow? I know I could loop through
Can a LINQ enabled app run on a machine that only has the .NET
Ever since Microsoft has introduced the application blocks, I've been bumping into people who
In developing a large C++ programming project with many developers, we have run into
I am developing an application with Fluent nHibernat/nHibernate 3/Sqlite. I have run into a
Can somebody point me to a resource that explains how to go about having

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.