开发者

Objective-c: sort NSMutableArray by OBJECT_IN_ARRAY.NSNUMBER

开发者 https://www.devze.com 2023-01-26 04:09 出处:网络
OK, this is my problem: I have a NSMutableArray (hsdbarray) with objects (highscoresdbObj) in it. I want to sort the objects in the array by 开发者_运维问答OBJECT.NSNumber (highscoresdbObj.hsdbname) d

OK, this is my problem:

I have a NSMutableArray (hsdbarray) with objects (highscoresdbObj) in it.

I want to sort the objects in the array by 开发者_运维问答OBJECT.NSNumber (highscoresdbObj.hsdbname) descending.

Could someone please help me?

Sincerly Jonny! :)


Create an NSSortDescriptor with the key "hsdbname" and descending order. Tell the array to sort using this descriptor.

0

精彩评论

暂无评论...
验证码 换一张
取 消