标签:ever 倒序 lob nslog enum ble objects with tar
1 NSMutableArray *array = [NSMutableArray arrayWithObjects:@"5",@"3",@"4",@"2",nil]; 2 3 // 倒序 4 5 NSMutableArray *resultArr = (NSMutableArray *)[[array reverseObjectEnumerator] allObjects]; 6 7 NSLog(@"倒序:%@",resultArr); // 倒序的结果为:2,4,3,5 8 9 10 // 升序 11 12 [array sortUsingSelector:@selector(compare:)]; 13 14 NSLog(@"升序:%@",array); // 升序的结果为:2,3,4,5 15 16 // 降序 17 18 NSEnumerator *enumerator = [array reverseObjectEnumerator]; 19 20 NSMutableArray *jxArr = (NSMutableArray *)[enumerator allObjects]; 21 22 NSLog(@"降序:%@",jxArr); // 降序的结果为:5,4,3,2
标签:ever 倒序 lob nslog enum ble objects with tar
原文地址:https://www.cnblogs.com/liuzhi20101016/p/11890411.html