Note that there are some explanatory texts on larger screens.

plurals
  1. POpopulating a groupped uitableView with sections dynamically
    primarykey
    data
    text
    <p>i am developing a view which contains a grouped UITableView and uses a XMLparser to get its data.</p> <p>my XMLParser stores NSDictionary data in a NSArray.</p> <p>in cellForRowAtIndexPath i wrote this in order to populate the UITableView dynamically:</p> <pre><code>-(UITableViewCell*) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"CellArticle"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } //configuration cellule if(mParser.summaryArray == nil||[mParser.summaryArray count]==0) { //do nothing } else { NSDictionary *sommaire=[mParser.summaryArray objectAtIndex:0]; cell.textLabel.text=[NSString stringWithFormat:@"%@",[sommaire objectForKey:kArticle]]; [mParser.summaryArray removeObject:[mParser.summaryArray objectAtIndex:0]]; } return cell; } </code></pre> <p>The problem is that when the view is loaded, cells are correctly set but when i scroll my table down cells get mixed and some of them are missing. Also when i reach the table limit it crashes and returns this error:</p> <p><em><strong></em>* Assertion failure in -[UITableView _createPreparedCellForGlobalRow:withIndexPath:], /SourceCache/UIKit_Sim/UIKit-1914.84/UITableView.m:6061</strong></p> <p><strong>* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'**</strong></p> <p>What may be the problem any idea please?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload