我想我從蘋果服務器收到發送產品編號列表後SKProduct的數組排序SKProduct陣列。如何按價格排序值
我想只用排序如下:
NSSortDescriptor *lowestPriceToHighest = [NSSortDescriptor sortDescriptorWithKey:@"self.price" ascending:YES];
NSArray *sortedProducts = [products sortedArrayUsingDescriptors:[NSArray arrayWithObject:lowestPriceToHighest]];
,但我得到了錯誤信息:Unable to access variable "lowestPriceToHighest"
被錯誤定義我的排序描述符?
應該是選擇的答案,謝謝! – tcd 2014-02-04 02:06:47