大佬教程收集整理的这篇文章主要介绍了ios – xcode 7不在模拟器中的解析表视图中显示数据,但在设备中工作,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
实际上,当我尝试将查询结果打印到控制台时,我确实得到了我的结果.
这是我为此视图启用的控制器代码:
import UIKit import Parse import ParseUI class MeetsTableViewController: PFQueryTableViewController { // Initialise the PFQueryTable tableview override init(style: UITableViewStyle,className: String!) { super.init(style: style,className: className) } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) // Configure the PFQueryTableView self.parseClassName = "Meets"; self.pullTorefreshEnabled = true; self.textKey="city"; self.paginationEnabled = false; } // Define the query that will provide the data for the table view override func queryForTable() -> PFQuery { let query = PFQuery(className: "Meets"); query.orderByDescending("numberOfComming"); return query; } override func tableView(tableView: UITableView,cellForRowATindexPath indexPath: NSIndexPath,object: PFObject?) -> PFTableViewCell { var cell = tableView.dequeueReusableCellWithIdentifier("MyCell") as! CarTableViewCell!; if cell == nil { cell = CarTableViewCell(style: UITableViewCellStyle.Default,reusEIDentifier: "MyCell"); } if let cityName = object?["city"] as? String{ cell?.meetName?.text = "מפגש ב\(cityName)"; } if let address = object?["address"] as? String{ cell?.meetAddress?.text = address; } if let date = object?["date"] as? String{ cell?.meetDate?.text = date; } if let time = object?["time"] as? String{ cell?.meetTime?.text = time; } if let people = object?["numberOfComming"] as? Int{ cell?.peopleAttending?.text = "\(peoplE)"; } print(object); // console is prinTing query results successfully if let thumbnail = object?["meetImg"] as? PFFile { thumbnail.getDataInBACkgroundWithBlock{ (imageData,error) -> Void in if error == nil { let image = UIImage(data: imageData!) cell.meetImage.image = image }} } return cell; }
}
我只是试图在我的设备中运行应用程序,并且表格正常运行,只是模拟器没有显示数据.
以上是大佬教程为你收集整理的ios – xcode 7不在模拟器中的解析表视图中显示数据,但在设备中工作全部内容,希望文章能够帮你解决ios – xcode 7不在模拟器中的解析表视图中显示数据,但在设备中工作所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。