标签:
/** * NSMutableArray 排序 * * @param dicArray 数据 * @param key 关键字排序 * @param yesOrNo 升序或降序排列,yes为升序,no为降序 */ - (void) orderArray:(NSMutableArray *)dicArray orderWithKey:(NSString *)key ascending:(BOOL)yesOrNo{ NSSortDescriptor *distanceDescriptor = [[NSSortDescriptor alloc] initWithKey:key ascending:yesOrNo]; NSArray *descriptors = [NSArray arrayWithObjects:distanceDescriptor,nil]; [dicArray sortUsingDescriptors:descriptors]; }
标签:
原文地址:http://www.cnblogs.com/wb145230/p/4386534.html