Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Your fetchedResultsController doesn't determine WHERE the fetched data is going to be inserted, this is up to your tableview dataSource methods to work out based on logic that you put in place.</p> <p>I don't have all the details of your implementation but the below should roughly do what you are trying to achieve. You simply need to test for the (section) value in certain parts of your code to work out how you are going to fill the data for sections and rows.</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"CellIdentifier"; UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease]; } if (indexPath == kSectionZero) { // Configure cell with data from NSArray here } else { NSManagedObject *yourObject = [self.fetchedResultsController objectAtIndexPath:indexPath]; // Configure cell with data from *yourObject here } } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { NSUInteger count = [[self.fetchedResultsController sections] count]; return count + X; // where X == number of additional sections you want, in your case X == 1 } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { if (section == 1) { id &lt;NSFetchedResultsSectionInfo&gt; sectionInfo = [[self.fetchedResultsController sections] objectAtIndex:section]; return [sectionInfo numberOfObjects] } else return [arrayObject count] } - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { if (section == 1) { NSString *sectionName = [[[self.fetchedResultsController sections] objectAtIndex:section] name]; return sectionName; } else return @"Whatever section name you want for section == 0 here"; } } </code></pre>
 

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