Re: Crash with UITableView reloadRowsAtIndexPaths:withRowAnimation:
Re: Crash with UITableView reloadRowsAtIndexPaths:withRowAnimation:
- Subject: Re: Crash with UITableView reloadRowsAtIndexPaths:withRowAnimation:
- From: Laurent Daudelin <email@hidden>
- Date: Wed, 22 Aug 2012 00:27:39 -0700
Well, it's a little complicated. There are 2 sections in the table view. The first section has 4 cells always, no more, no less. They like static but since the second section of the tableview is dynamic, I cannot make the tableview with static cells. So, when I get the information to display in those 4 cells, I thought to call the reloadRowsAtIndexPath:withRowAnimation:. Note that I'm not adding or removing cells. Its just that when the tableview appears, the data hasn't been received from the server. I just wanted to minimize the reload that the table view would have to do because the second section is dynamic and when I get the data for the first section, I query the server for the data of the second section, so when I have the data for the cells in section 1, I just want to reload that section.
Is there something wrong in my reasoning? Since the connection to the server is asynchronous, it is possible that I might be changing the number of rows in section 2, but I'm only trying here to reload section 1. Maybe my reasoning is wrong, that would explain why it fails.
-Laurent.
--
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin http://www.nemesys-soft.com/
Logiciels Nemesys Software email@hidden
On Aug 22, 2012, at 00:02, Luke Hiesterman <email@hidden> wrote:
> You need to read the actual exception message. It's almost certainly telling you that the number of rows in the dataSource is different than what's expected based on the updates you've made.
>
> Luke
>
> On Aug 21, 2012, at 11:49 PM, "Laurent Daudelin" <email@hidden> wrote:
>
>> iOS 5.0 simulator or device.
>>
>> When I call this method like this:
>> [[NSOperationQueue mainQueue] addOperationWithBlock:^{
>> [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:
>> [NSIndexPath indexPathForRow:0 inSection:0],
>> [NSIndexPath indexPathForRow:1 inSection:0],
>> [NSIndexPath indexPathForRow:2 inSection:0],
>> [NSIndexPath indexPathForRow:3 inSection:0],
>> nil]
>> withRowAnimation:UITableViewRowAnimationNone];
>> }];
>>
>> the app crashes with a SIGTRAP:
>> 2012-08-21 23:48:05.173 Erodr[15594:c07] *** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-1912.3/UITableView.m:1046
>>
>> However, if I send the same tableview reloadData, then all is fine.
>>
>> What's wrong with my reloadRowsAtIndexPath:withRowAnimations:?
>>
>> -Laurent.
>> --
>> Laurent Daudelin
>> AIM/iChat/Skype:LaurentDaudelin http://www.nemesys-soft.com/
>> Logiciels Nemesys Software email@hidden
>>
>>
>> _______________________________________________
>>
>> Cocoa-dev mailing list (email@hidden)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden