2
var nomes:NSArray = []
override func viewDidLoad() {
super.viewDidLoad()
Alamofire.request(.GET, MyUrl,parameters: nil,encoding: .JSON).response { (_, _, data, error) in
self.nomes = try! NSJSONSerialization.JSONObjectWithData(data!, options: NSJSONReadingOptions()) as! NSArray
print(self.nomes)
}
}
and I’m getting this information:
[{"nome":"marcos","idade":"23","altura":"1.83"},
{"nome":"ivan","idade":"25","altura":"1.89"},
{"nome":"pedro","idade":"21","altura":"1.78"}]
would like to inform on Tableview’s Cell "name" in the textLabel field and "height" as detailLabel
cell.textLabel!.text = nomes[indexPath.row].objectForKey("nome")