0
첫 번째 문자로 상태의 도시를 구성하는 인덱싱 된 테이블 뷰가 있습니다. NSMutableDictionary는 A, B, C 등의 키로 생성됩니다. 해당 도시가 각각의 배열에 추가됩니다. 예는 :UITableView 인덱싱
지금Y = (
Yatesboro,
Yeagertown,
York,
"York Haven",
"York New Salem",
"York Springs",
Youngstown,
Youngsville,
Youngwood,
Yukon
);
Z = (
Zelienople,
Zieglerville,
"Zion Grove",
Zionhill,
Zionsville,
Zullinger
);
, 올바른 섹션의 수, 행 섹션 내 및 인덱싱 제어 내 테이블 뷰 하중이와 함께 잘 작동 :
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return [cities count];
}
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
if([searchArray count]==0)
return @"";
return [searchArray objectAtIndex:section];
}
// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [[cities objectForKey:[searchArray objectAtIndex:section]] count];
}
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index {
NSLog([NSString stringWithFormat:@"clicked index : %i",index]);
if (index == 0) {
[tableView scrollRectToVisible:[[tableView tableHeaderView] bounds] animated:NO];
return -1;
}
return index;
}
내 문제는 이제 텍스트를 채우고 각 섹션에 대한 텍스트와 테이블 셀의 ... 내가이 정보를 잡을 수있는 방법에 대한 생각?
매력적인 남자처럼 일했습니다. 나에게 큰 두통을 안겨 줬다. 감사! – rson