我正在制作一个应用程序,它从解析中检索图像并将其显示到集合视图中。当用户点击图像时,图像显示得很详细。我有一个文本字段,用户可以更改。当用户更改某些内容时,他们按下“保存”按钮并返回到集合视图。返回到集合视图控制器的代码不起作用。
@IBAction func saveButton(sender: AnyObject) {
// Use the sent country object or create a new country PFObject
if let saveInBackWithBlock = currentObject as PFObject? {
updateObject = currentObject! as PFObject
} else {
updateObject = PFObject(className:"Tops")
}
// Update the object
if let updateObject = updateObject {
updateObject["imageText"] = topsLabel.text
// Create a string of text that is used by search capabilites
var searchText = (topsLabel.text)
updateObject["searchText"] = searchText
// Update the record ACL such that the new record is only visible to the current user
updateObject.ACL = PFACL(user: PFUser.currentUser()!)
// Save the data back to the server in a background task
updateObject.saveInBackgroundWithBlock{
(success: Bool, error: NSError?) -> Void in
if (success) {
// The object has been saved.
} else {
// There was a problem, check error.description
}
}
print("saved")
}
self.navigationController?.popViewControllerAnimated(true)
}我不知道为什么它不回到以前的视图controller.Thank you
发布于 2015-07-27 14:44:34
父视图是否嵌入到导航控制器中?还有-如何提出看法?
从您刚才添加的帖子-您不能弹出一个模式VC -尝试取消视图控制器。
发布于 2015-07-27 15:04:24
检查它是否嵌入到导航控制器中,尝试:
希望能帮上忙。
https://stackoverflow.com/questions/31656147
复制相似问题