Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @implementation PrefViewController
- [array release];
- [super viewDidLoad];
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- static NSString *CheckMarkCellIdentifier = @"CheckMarkCellIdentifier";
- UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CheckMarkCellIdentifier];
- NSUInteger row = [indexPath row];
- NSUInteger oldRow = [lastIndexPath row];
- if(indexPath.section == 1)
- {
- if (cell == nil)
- {
- cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CheckMarkCellIdentifier] autorelease];
- if (indexPath.row == 0)
- cell.accessoryType = UITableViewCellAccessoryCheckmark;
- }
- cell.text = [listData objectAtIndex:row];
- cell.accessoryType = (row == oldRow && lastIndexPath != nil) ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
- }
- else
- {
- if (cell == nil)
- {
- cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CheckMarkCellIdentifier] autorelease];
- }
- cell.text = [aboutData objectAtIndex:row];
- cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
- }
- return cell;
- if (indexPath.row == 0)
- cell.accessoryType = UITableViewCellAccessoryCheckmark;
- if (cell.accessoryType == UITableViewCellAccessoryNone) {
- cell.accessoryType = UITableViewCellAccessoryCheckmark;
- }
- else if (cell.accessoryType == UITableViewCellAccessoryCheckmark) {
- cell.accessoryType = UITableViewCellAccessoryNone;
- }
Add Comment
Please, Sign In to add comment