按编号对对象进行排序

时间:2015-08-01 14:41:31

标签: ios objective-c cocoa-touch sorting parse-platform

我在Parse数据库中有一些对象,其中一些如下所示。我想通过highScore对这些对象进行排序,highScore存储为数字。 (

    app.controller('testCtrl',function($scope){

$http.get('your/api/that/returns/json/').then(function(result){
 $scope.items = result.data;
})

    });

我有以下代码,我遍历对象并为每个对象提取Number highScore,但我不知道如何继续。有没有办法可以返回(NSComparisonResult)NSOrderedAscending?如果有人有任何建议,请告诉我。感谢。

"<Score: 0x7fee53740700, objectId: zMjL3eNWpI, localId: (null)> {\n    Score = \"High Score: 60\";\n    TeamName = \"Team0\";\n    highScore = 60;\n}",

"<Score: 0x7fee534b5080, objectId: nysaJjYsth, localId: (null)> {\n    Score = \"High Score: 86\";\n    TeamName = Team1;\n    highScore = 86;\n}",

"<Score: 0x7fee535f6ad0, objectId: 7Hj8RP4wYD, localId: (null)> {\n    Score = \"High Score: 23\";\n    TeamName = Team2;\n    highScore = 23;\n}"

1 个答案:

答案 0 :(得分:2)

Parse.com提供了一个出色的iOS SDK,它已经为您提供了所需的开箱即用产品。制作 RewriteEngine On RewriteRule ^jobs/([^/]*)/([^/]*)\.html$ /job_details.php?query_string=$1&action=$2 [L] 时,Parse会为您提供按照您希望的方式订购结果的选项。我相信你应该试试这个:

<Redirect />