Note that there are some explanatory texts on larger screens.

plurals
  1. POData from Plist is Incorrectly Ordered in UITableView
    text
    copied!<p>I have data that is stored in a plist but when I pull it to my UITableView it gets reordered for some reason. Here are my table view data source methods:</p> <pre><code>- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return [self.lunch_Dinner count]; } - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { return [[self.lunch_Dinner allKeys] objectAtIndex:section]; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { NSString *typeOfEntree = [self tableView:tableView titleForHeaderInSection:section]; return [[self.lunch_Dinner valueForKey:typeOfEntree] count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"EntreeCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } // Configure the cell... NSString *typeOfEntree = [self tableView:tableView titleForHeaderInSection:indexPath.section]; NSString *entree = [[self.lunch_Dinner valueForKey:typeOfEntree] objectAtIndex:indexPath.row]; cell.textLabel.text = entree; return cell; } </code></pre> <p>Here is the order of the plist:</p> <ul> <li>Appetizers</li> <li>Soups</li> <li>Pastas</li> <li>Pizzas</li> <li>Specials</li> </ul> <p>And this is the resulting order in the UITableView after being compiled:</p> <ul> <li>Pizzas</li> <li>Soups</li> <li>Appetizers</li> <li>Pastas</li> <li>Specials</li> </ul> <p>Any help would be great! Thanks in advance.</p>
 

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