Changeset 84
- Timestamp:
- 10/09/08 11:26:20 (5 years ago)
- Location:
- apps/iphone/sampleTelApp/trunk/Classes
- Files:
-
- 2 modified
-
sampleTelAppViewController.h (modified) (1 diff)
-
sampleTelAppViewController.m (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
apps/iphone/sampleTelApp/trunk/Classes/sampleTelAppViewController.h
r82 r84 25 25 NSMutableArray *locArray; 26 26 NSMutableArray *otherArray; 27 NSMutableString *requestedDomain; 27 28 28 29 IBOutlet UITableView *telTable; -
apps/iphone/sampleTelApp/trunk/Classes/sampleTelAppViewController.m
r82 r84 59 59 locArray = [[NSMutableArray arrayWithCapacity:1] retain]; 60 60 otherArray = [[NSMutableArray arrayWithCapacity:1] retain]; 61 } 61 } 62 requestedDomain = [[NSMutableString stringWithString:@""] retain]; 62 63 } 63 64 … … 94 95 95 96 // Append ".tel" if it was not provided 96 NSMutableString *requestedDomain = [NSMutableString stringWithString:domain];97 [requestedDomain setString:domain]; 97 98 if (![requestedDomain hasSuffix:@".tel"]) { 98 99 [requestedDomain appendString:@".tel"]; … … 210 211 cell = (UITableViewCell *)[naptrCellNib objectAtIndex:1]; 211 212 } 213 212 214 [(UILabel *)[cell viewWithTag:1] setText:theRec.serviceDescription]; 213 215 [(UILabel *)[cell viewWithTag:2] setText:theRec.labelDescription]; 214 [(UILabel *)[cell viewWithTag:3] setText:theRec.uriContent]; 216 217 // Check if it's a nonterminal naptr. If so, add the accessory indicator 218 // and remove the trailing part of the string if it is a subdomain of the current domain 219 if (theRec.isTerminal) { 220 [(UILabel *)[cell viewWithTag:3] setText:theRec.uriContent]; 221 } else { 222 if ([[theRec.uriContent lowercaseString] hasSuffix:[requestedDomain lowercaseString]]) { 223 NSUInteger suffixIndex = [theRec.uriContent length] - [requestedDomain length] - 1; 224 [(UILabel *)[cell viewWithTag:3] setText:[theRec.uriContent substringToIndex:suffixIndex]]; 225 } else { 226 [(UILabel *)[cell viewWithTag:3] setText:theRec.uriContent]; 227 } 228 [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator]; 229 } 230 215 231 return cell; 216 232 }








