Hi i want to populate this tableview
i don't use the static table view because i take an error, and i decide to use the dynamic table view and disable the scroll in the table. The table view is use only for the information :
@IBOutlet var tableInfoQuake: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
navigationItem.title = quake.place
tableInfoQuake.cellForRowAtIndexPath(NSIndexPath(forRow: 0, inSection: 0))?.textLabel?.text = quake.place
tableInfoQuake.cellForRowAtIndexPath(NSIndexPath(forRow: 0, inSection: 0))?.textLabel?.text = "Mag: \(quake.mag)"
tableInfoQuake.cellForRowAtIndexPath(NSIndexPath(forRow: 1, inSection: 0))?.textLabel?.text = "Cordinate: (\(quake.longitude),\(quake.latitude))"
tableInfoQuake.cellForRowAtIndexPath(NSIndexPath(forRow: 1, inSection: 0))?.textLabel?.text = "Depth: \(quake.depth)"
but in the table view i don't visualize nothing. how can i do? thank you.
EDIT: i do this to modify each row :
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cellIdentifier = "quakeInfo"
var cell:UITableViewCell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath) as UITableViewCell
if indexPath == NSIndexPath(forRow: 0, inSection: 0){
cell.textLabel!.text = quake.place
cell.detailTextLabel!.text = "Mag: \(quake.mag)"
}
if indexPath == NSIndexPath(forRow: 1, inSection: 0){
cell.textLabel!.text = "Cordinate: (\(quake.longitude),\(quake.latitude))"
cell.detailTextLabel!.text = "Depth: \(quake.depth)"
}
return cell
}