i use MWFeedParser library to parse xml.
when i change the numberOfRowsInSection to +1 (return [itemsToDisplay count] +1;)
to make the last cell row for the Load more option my app crash in this line:
MWFeedItem *item = [itemsToDisplay objectAtIndex:indexPath.row];
any idea why this happens?
wel you are trying the get an item from an array that is beyond the the number of items in that array. (also accept some anser, people are more willing to anser if you accept answers)
Ex:
You do a plus 1 in the
numberOfRowsInSectionwhich, by example, return 11.That means that there are 10 item in the
itemsToDisplayarray.You are retrieving item from the
itemsToDisplayin withMWFeedItem *item = [itemsToDisplay objectAtIndex:indexPath.row]but you cant retrieve item number 11 because it does not exists.In the
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath: