开发者

How to sort an array of an array of objects by those objects attributes

开发者 https://www.devze.com 2023-01-18 13:00 出处:网络
If have an NSMutableArray foo of an NSMutableArray bar of objects. Each of the objects have a property that is a numerical value. In each NSMutableArray bar I want to sum this numerical property of ea

If have an NSMutableArray foo of an NSMutableArray bar of objects. Each of the objects have a property that is a numerical value. In each NSMutableArray bar I want to sum this numerical property of each object. Then I want to sort the NSMutableArray foo by this sum. What's a good way to do this开发者_如何学Python?


Take a look at NSSortDescriptor.

0

精彩评论

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