Skip to content

Commit

Permalink
Don't use multiple sections
Browse files Browse the repository at this point in the history
  • Loading branch information
oscardelben committed Dec 28, 2010
1 parent e2346f4 commit 133e2ad
Show file tree
Hide file tree
Showing 15 changed files with 130 additions and 128 deletions.
35 changes: 8 additions & 27 deletions Classes/RootViewController.m
Expand Up @@ -88,23 +88,11 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface


- (void)configureCell:(CustomCell *)cell atIndexPath:(NSIndexPath *)indexPath {
switch (indexPath.section) {
case 0:
cell.name.text = @"foo";
break;
case 1: {
NSManagedObject *managedObject = [[self.fetchedResultsController fetchedObjects] objectAtIndex:indexPath.row];
cell.name.text = [managedObject valueForKey:@"name"];
cell.name.delegate = self;
break;
}
}

// NSManagedObject *managedObject = [self.fetchedResultsController objectAtIndexPath:indexPath];
//
// cell.name.text = [managedObject valueForKey:@"name"];
// cell.name.delegate = self;

NSManagedObject *managedObject = [self.fetchedResultsController objectAtIndexPath:indexPath];

cell.name.text = [managedObject valueForKey:@"name"];
cell.name.delegate = self;
}


Expand Down Expand Up @@ -175,20 +163,13 @@ - (void)showKeyboard:(NSIndexPath *)indexPath
#pragma mark Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
// return [[self.fetchedResultsController sections] count];
return 2;
return [[self.fetchedResultsController sections] count];
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// id <NSFetchedResultsSectionInfo> sectionInfo = [[self.fetchedResultsController sections] objectAtIndex:section];
// return [sectionInfo numberOfObjects];
switch (section) {
case 0:
return 1;
case 1:
return [[self.fetchedResultsController fetchedObjects] count];
}
id <NSFetchedResultsSectionInfo> sectionInfo = [[self.fetchedResultsController sections] objectAtIndex:section];
return [sectionInfo numberOfObjects];
}


Expand Down Expand Up @@ -299,7 +280,7 @@ - (NSFetchedResultsController *)fetchedResultsController {
if (fetchedResultsController_ != nil) {
return fetchedResultsController_;
}
/*
Set up the fetched results controller.
*/
Expand Down
9 changes: 5 additions & 4 deletions Ideas.xcodeproj/oscardelben.mode1v3
Expand Up @@ -274,8 +274,9 @@
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
<integer>18</integer>
<integer>17</integer>
<integer>3</integer>
<integer>1</integer>
<integer>0</integer>
</array>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
Expand Down Expand Up @@ -328,15 +329,15 @@
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
<string>BFA0DBE812CA82E900C07211</string>
<string>BFA0DBEE12CAA66500C07211</string>
<key>history</key>
<array>
<string>BFA0DAA312C8F50400C07211</string>
<string>BFA0DAA412C8F50400C07211</string>
<string>BFA0DADC12C907F300C07211</string>
<string>BFA0DB0412C90DD400C07211</string>
<string>BFA0DB0512C90DD400C07211</string>
<string>BFA0DB9A12CA7B9000C07211</string>
<string>BFA0DBED12CAA66500C07211</string>
</array>
</dict>
<key>SplitCount</key>
Expand Down

0 comments on commit 133e2ad

Please sign in to comment.