2011-10-04 1 views
0

다음은 내가 추가 한 것입니다. 알파벳 문자 하나 하나 아래에있는 모든 objectsForCharacters를 나열합니다.Three20 titleForHeaderInSection

- (void)tableViewDidLoadModel:(UITableView*)tableView { 
items = [[NSMutableArray alloc] init]; 
arrayOfCharacters = [[NSMutableArray alloc]init]; 
objectsForCharacters = [[NSMutableDictionary alloc]init]; 
    NSMutableArray *arrayOfNames = [[NSMutableArray alloc]init]; 
for (Kid_CareAppDelegate_City* post in _searchFeedModel.posts) { 
    [arrayOfNames addObject:post.city]; 
    [items addObject:[TTTableTextItem itemWithText:post.city 
               URL:[NSString stringWithFormat:@"tt://city?to=%@",[post.city stringByReplacingOccurrencesOfString:@" " withString:@"+"]]]]; 
} 
for(char c='A';c<='Z';c++){ 
    [arrayOfCharacters addObject:[NSString stringWithFormat:@"%c",c]]; 
    [objectsForCharacters setObject:arrayOfNames forKey:[NSString stringWithFormat:@"%c",c]]; 
} 
NSLog(@"Array %@",arrayOfCharacters); 
NSLog(@"Dict %@",objectsForCharacters); 
    TT_RELEASE_SAFELY(arrayOfNames); 

self.items = items; 
TT_RELEASE_SAFELY(items); 
} 

답변