Go to the source code of this file.
|
static NSComparisonResult | goodsSorter (id a, id b, void *context) |
|
◆ goodsSorter()
static NSComparisonResult goodsSorter |
( |
id | a, |
|
|
id | b, |
|
|
void * | context ) |
|
static |
Definition at line 408 of file OOCommodityMarket.m.
409{
410 NSDictionary *commodityList = (NSDictionary *)context;
411 int v1 = [[commodityList oo_dictionaryForKey:(NSString *)a] oo_intForKey:kOOCommoditySortOrder];
412 int v2 = [[commodityList oo_dictionaryForKey:(NSString *)b] oo_intForKey:kOOCommoditySortOrder];
413
414 if (v1 < v2)
415 {
416 return NSOrderedAscending;
417 }
418 else if (v1 > v2)
419 {
420 return NSOrderedDescending;
421 }
422 else
423 {
424 return NSOrderedSame;
425 }
426}