• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Weird crash on iOS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Weird crash on iOS


  • Subject: Re: Weird crash on iOS
  • From: Igor Delovski <email@hidden>
  • Date: Wed, 19 Sep 2012 08:11:19 -0700 (PDT)

Hi,

-reloadRowsAtIndexPaths:withRowAnimation: was crashing if I used it when user moved cells in edit mode. I had delayed load of icons and as an icon becoms available, calling -reloadRowsAtIndexPaths:withRowAnimation worked well. Only if a user draggs a cell outside of visible range, when a new cell needs to be displayed, this method would crash.

So, now I use it only if the table is not in edit mode. In that case I just call -reloadData.

And I use a lot of delayed -performSelector: but only because I don't want to change my projects now when I know how problematic it can be. It is very important to call -cancelPreviousPerformRequestsWithTarget... in -viewWillDisappear:.

Using timers would be much safer and simpler thing to do - if only I knew that two years ago.

--- On Wed, 9/19/12, Glenn L. Austin <email@hidden> wrote:

From: Glenn L. Austin <email@hidden>
Subject: Re: Weird crash on iOS
To: "Laurent Daudelin" <email@hidden>
Cc: "email@hidden Users" <email@hidden>
Date: Wednesday, September 19, 2012, 3:47 PM

On Sep 19, 2012, at 1:17 AM, Laurent Daudelin <email@hidden> wrote:

> I see what you mean. Well, I'm not trying to recreate a state machine. For example, I have a bunch of UITableViewCells that download content from a server, including images. When they are done, I want to refresh the table view because the pictures will not display. However, I don't want to reload the table view each time a cell has got its content, so, they send a message to the UITableViewController which then cancel any previous performAfterDelay that could be pending and then issue a performAfterDelay to reload the table view. So, if there is a delay of more than 3 seconds, the table view will reload, otherwise, it will keep pushing out the reload until most cells have received their contents. Of course, the content of the cells is partially visible as the text portion is quick to setup. It's the images attached to the cells that can take a variable amount of time.


If you can avoid it (and you can), don't reload the entire table just to redraw a few cells -- just force those specific cells to redraw with reloadRowsAtIndexPaths:withRowAnimation:.

--
Glenn L. Austin, Computer Wizard and Race Car Driver         <><
<http://www.austin-soft.com>


_______________________________________________
Do not post admin requests to the list. They will
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Weird crash on iOS (From: "Glenn L. Austin" <email@hidden>)

  • Prev by Date: Breakpoints stopped working
  • Next by Date: Re: Strange problem with UIButton in bar button item
  • Previous by thread: Re: Weird crash on iOS
  • Next by thread: Re: Weird crash on iOS
  • Index(es):
    • Date
    • Thread