나는 데이터베이스 응용 프로그램을 만들고 있는데, 나는 sqlite 데이터베이스에서 결과를 추출하여 테이블에 넣을 수있다. 그러나 섹션에서 알파벳 순으로 정렬해야한다. 이 모두가 잘 작동Sectionable tableview problem
그래서 지금은이 코드
AArray = [[NSMutableArray alloc] init];
BArray = [[NSMutableArray alloc] init];
CArray = [[NSMutableArray alloc] init];
DArray = [[NSMutableArray alloc] init];
EArray = [[NSMutableArray alloc] init];
FArray = [[NSMutableArray alloc] init];
GArray = [[NSMutableArray alloc] init];
HArray = [[NSMutableArray alloc] init];
IArray = [[NSMutableArray alloc] init];
JArray = [[NSMutableArray alloc] init];
KArray = [[NSMutableArray alloc] init];
LArray = [[NSMutableArray alloc] init];
MArray = [[NSMutableArray alloc] init];
NArray = [[NSMutableArray alloc] init];
OArray = [[NSMutableArray alloc] init];
PArray = [[NSMutableArray alloc] init];
QArray = [[NSMutableArray alloc] init];
RArray = [[NSMutableArray alloc] init];
SArray = [[NSMutableArray alloc] init];
TArray = [[NSMutableArray alloc] init];
UArray = [[NSMutableArray alloc] init];
VArray = [[NSMutableArray alloc] init];
WArray = [[NSMutableArray alloc] init];
XArray = [[NSMutableArray alloc] init];
YArray = [[NSMutableArray alloc] init];
ZArray = [[NSMutableArray alloc] init];
을하고 난 관련 배열로 데이터베이스에서 각 항목을 이동하는 코드가 있습니다.
나는 다음이 코드를 가지고 : 내가 그것을 잘 작동 실행하면 내가 위로 몇 번 아래로 스크롤 그러나 경우,
All = [NSMutableDictionary dictionaryWithObjectsAndKeys:AArray,@"A",BArray,@"B",CArray,@"C",DArray,@"D",EArray,@"E",FArray,@"F",GArray,@"G",HArray,@"H",IArray,@"I",JArray,@"J",KArray,@"K",LArray,@"L",MArray,@"M",NArray,@"N",OArray,@"O",PArray,@"P",QArray,@"Q",RArray,@"R",SArray,@"S",TArray,@"T",UArray,@"U",VArray,@"V",WArray,@"W",XArray,@"X",YArray,@"Y",ZArray,@"Z",nil];
AllArray = [NSArray alloc];
AllArray = [AllArray initWithArray:[[All allKeys]sortedArrayUsingSelector:@selector(compare:)]];
이
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
// Return the number of sections.
return [AllArray count];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return the number of rows in the section.
NSArray *Array = [All objectForKey:[AllArray objectAtIndex:section]];
return [Array count];
}
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
int sectionindex = section;
return [AllArray objectAtIndex:sectionindex];
}
을 오류 메시지없이 응용 프로그램이 충돌 . 내가 그들에 추가 할 때 충돌되는 것과 같이 함께 할 수있는 뭔가,하지만 난 그냥 시간 파일에 선언 잘못된
Everythings을하고 어떤 메신저를 볼 수 없습니다 그리고 난 @property와 @synthesize 다음
@property (nonatomic,retain) NSMutableDictionary *All;
@property (nonatomic,retain) NSArray *AllArray;
@property (nonatomic, retain) UITableView *TableView;
누군가 나를 도울 수 있다면 정말 좋을 것입니다!
감사합니다.
이 그것을 해결했다 ! 매우 감사합니다! – ApiMail
웹 사이트가 허용하는대로 답변을 수락합니다. – ApiMail