【发布时间】:2015-05-21 03:42:14
【问题描述】:
当我运行此代码时,它不会将 alertLabel 更新为我在解析时设置的消息。我没有收到任何错误,并且标签已正确链接到我的 ViewController 类。
我对编码非常陌生,因此非常感谢您的帮助。提前致谢。
class ViewController: UIViewController {
@IBOutlet weak var alertLabel: UILabel!
var output : PFObject!
let theObjectID = "M0qEFWMxYI"
let theClass = "bobcatStatus"
override func viewDidLoad() {
super.viewDidLoad()
}
func displayData() {
var thisQuery = PFQuery(className: theClass)
thisQuery.getObjectWithId(theObjectID)
if let alertOutput = output["alertMessage"] as? String {
alertLabel.text = alertOutput
}
else {
alertLabel.text = "Error loading data."
}
}
// Do any additional setup after loading the view, typically from a nib.
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
Xcode 6.2.3
【问题讨论】:
标签: ios xcode swift parse-platform