0
我創建了一個帶有27個部分的tableview,這些部分都是字母表,現在我需要做的是,我想根據部分過濾數據,這意味着在「 A「我想要所有以字母」A「開頭的單元格。如何對錶中的數據進行排序在字段中查看
我創建了一個帶有27個部分的tableview,這些部分都是字母表,現在我需要做的是,我想根據部分過濾數據,這意味着在「 A「我想要所有以字母」A「開頭的單元格。如何對錶中的數據進行排序在字段中查看
for (id alphabet in allSecionArray) {
if ([searchString hasPrefix:alphabet]) {
NSLog(@"Result is %@", searchString); // which you can add your result in your NSmutuable resultArray
}
}
for(int i=0;i<[list count];i++){
NSString *newString;
NSString *mystring;
newString=[list1 objectAtIndex:i];
if(([newString characterAtIndex:0] == 'a')||[newString characterAtIndex:0] == 'A'){
// mystring = [newString substringFromIndex:0];
mystring=newString;
//[self.giftlist1 addObjectsFromArray:giftlist];
[self.listA addObject:mystring];
}