NSSortDescriptor evaluating ascending numbers (Swift)

前端 未结 3 1149
面向向阳花
面向向阳花 2021-01-18 01:00

App has contentid coming in as a number string from a json file:

let contentid: AnyObject! = jsonFeed[\"contentid\"]

let stream:Dictionary = [
         


        
3条回答
  •  终归单人心
    2021-01-18 01:27

            let descriptor: NSSortDescriptor = NSSortDescriptor(key: "message_time", ascending: true)
            let sortedResults = arrayForMessages.sortedArray(using: [descriptor])
            print(sortedResults)
    

提交回复
热议问题