Created
March 12, 2013 15:05
-
-
Save cliftonlabrum/5143657 to your computer and use it in GitHub Desktop.
Grouped UITableView in Objective-C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Customize the appearance of table view cells. | |
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
static NSString *CellIdentifier = @"Cell"; | |
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; | |
if (cell == nil) { | |
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease]; | |
} | |
cell.accessoryType = UITableViewCellAccessoryNone; | |
cell.accessoryView = nil; | |
cell.detailTextLabel.text = nil; | |
cell.imageView.image = nil; | |
// Configure the cell... | |
if (indexPath.section == kSyncingSection) | |
{ | |
cell.textLabel.text = @"Sync"; | |
cell.detailTextLabel.text = self.syncType; | |
cell.imageView.image = self.syncImage; | |
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment