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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:59:26+00:00 2026-06-05T11:59:26+00:00

I am animating a scroll view content inset for pull down to refresh. NSLog(@

  • 0

I am animating a scroll view content inset for pull down to refresh.

NSLog(@" in main thread? %d", [NSThread isMainThread]); // prints 1
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:.3];
[scrollView setContentInset:UIEdgeInsetsMake(0.0f, 0.0f, scrollView.contentInset.bottom, 0.0f)];
// Crash here
[UIView commitAnimations];

I get a crash when committing the animations and it crashes it the main thread. If I remove this block of code, my app never crashes. What could be causing a crash at this point if it’s pretty much narrowed down to this block of code?

  • 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-05T11:59:28+00:00Added an answer on June 5, 2026 at 11:59 am

    Since the animation was to scroll and cellForRowAtIndexPath referenced results from a Core Data fetch request, the animation crashed the app since I accidentally did it right before reloading the table view data. This occurred because data in the table view was no longer available so the animation scrolled to a row that no longer existed.

    Lesson learned – if you’re working with scrollview animations and Core Data, be careful about when you choose to reload your table view data. Don’t perform the fetch, then scroll, then reload your table view data. Do perform the fetch, then reload your table view data, then scroll.

    It would have been really obvious had there been an error message with the crash.

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

Sidebar

Related Questions

I have a UIView with content and I am implementing a pull-to-refresh feature. How
I'm doing that pull-down-to-refresh thing. In scrollViewDidEndDecelerating I check if the offset is past
I have an scroll view with some sophisticated animations happening during scrolling. Although after
I have a scroll view and I want to make it disappear whenever a
I'm creating a custom (layer-hosting) document view, which is contained within a scroll view.
I have read Apple Scroll View Programming Guide for iOS but still confused about
I crated a zoom animation using CGAffineTransformScaleMake, [UIView beginAnimations:nil context:view]; [UIView setAnimationDuration: 0.4f]; [UIView
i´ve built a nested scroll view. in the view.xib there is in the view
I'm animating a UIView (or rather its CALayer) and at the end of the
I'm having a problem with the zoomToRect function. I have a scroll view that

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.