程序员人生 网站导航

tableview的索引值

栏目:综合技术时间:2015-02-11 08:27:31

NSMutableArray *siftArray = [NSMutableArray array];

    NSArray *sources = @[@"dfersa",@"adfae",@"frdg",@"rfde",@"drgs",@"wser",@"rfdt",@"pkoi"];

//    [self.sources addObjectsFromArray : [JKCountryResout searchCountryNameByStrings:@"china"]];

    for (NSString *str in self.sources){

        NSString *resoultStr = [str substringToIndex:1];

        [siftArray addObject:resoultStr];

    }

    NSSet *set = [NSSet setWithArray:siftArray];

    NSArray *sortDesc = @[[[NSSortDescriptor alloc] initWithKey:nil ascending:YES]];

    NSArray *sortSetArray = [set sortedArrayUsingDescriptors:sortDesc];

    NSLog(@"排序的结果 %@", sortSetArray);


------分隔线----------------------------
------分隔线----------------------------

最新技术推荐