Developer Area

Changeset 647

Show
Ignore:
Timestamp:
01/14/10 16:29:11 (2 months ago)
Author:
henri
Message:

Nicer cells

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • apps/iphone/my.tel/trunk/Classes/AccountViewController.m

    r643 r647  
    185185     
    186186        static NSString *DomainCellIdentifier = @"AccountDomainCell"; 
     187        static NSString *DSDomainCellIdentifier = @"AccountDomainCellWithDS"; 
    187188    static NSString *ButtonCellIdentifier = @"ButtonCell"; 
    188189    
     
    192193        switch (indexPath.section) { 
    193194                case kKAccountTableViewSectionDomains: 
    194                         cell = [tableView dequeueReusableCellWithIdentifier:DomainCellIdentifier]; 
    195                         if (cell == nil) { 
    196                                 cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:DomainCellIdentifier] autorelease]; 
    197                                 cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 
     195                        theDomain = [self.domainsArray objectAtIndex:indexPath.row]; 
     196                        if ([theDomain objectForKey:@"displayString"] != nil) { 
     197                                cell = [tableView dequeueReusableCellWithIdentifier:DSDomainCellIdentifier]; 
     198                                if (cell == nil) { 
     199                                        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:DSDomainCellIdentifier] autorelease]; 
     200                                        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 
     201                                } 
     202                                cell.detailTextLabel.text = [theDomain objectForKey:@"displayString"]; 
     203                        } else { 
     204                                cell = [tableView dequeueReusableCellWithIdentifier:DomainCellIdentifier]; 
     205                                if (cell == nil) { 
     206                                        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:DomainCellIdentifier] autorelease]; 
     207                                        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 
     208                                }                                
    198209                        } 
    199                         theDomain = [self.domainsArray objectAtIndex:indexPath.row]; 
    200210                        cell.textLabel.text = [theDomain objectForKey:@"name"]; 
    201                         cell.detailTextLabel.text = [theDomain objectForKey:@"displayString"]; 
    202211                        break; 
    203212                case kKAccountTableViewSectionEditSettings: 
     
    207216                                                                                           reuseIdentifier:ButtonCellIdentifier] autorelease]; 
    208217                                cell.accessoryType = cell.editingAccessoryType = UITableViewCellAccessoryNone; 
     218                                cell.textLabel.textAlignment = UITextAlignmentCenter; 
    209219                        } 
    210220                        cell.textLabel.textColor = [UIColor blueColor]; 
    211                         cell.textLabel.textAlignment = UITextAlignmentCenter; 
    212221                        cell.textLabel.text = @"Edit Account Settings"; 
    213222                        break; 
     
    218227                                                                                           reuseIdentifier:ButtonCellIdentifier] autorelease]; 
    219228                                cell.accessoryType = cell.editingAccessoryType = UITableViewCellAccessoryNone; 
     229                                cell.textLabel.textAlignment = UITextAlignmentCenter; 
    220230                        } 
    221231                        cell.textLabel.textColor = [UIColor redColor]; 
    222                         cell.textLabel.textAlignment = UITextAlignmentCenter; 
    223232                        cell.textLabel.text = @"Remove Account"; 
    224233                        break;                   
Telnic
Search This Site
Partners
Neustar
ICANN
Main site | WHOIS | Sell .tel | FAQ | Archived Site | About Telnic | Contact Us