gpt4 book ai didi

ios - popViewController 不返回

转载 作者:行者123 更新时间:2023-11-28 13:10:07 25 4
gpt4 key购买 nike

我正在制作一个应用程序,它从解析中检索图像并将其显示到 Collection View 中。当用户点击图像时,图像会详细显示。我有一个用户可以更改的文本字段。当用户更改某些内容时,他们会点击保存按钮并返回到 Collection View 。返回到 Collection View Controller 的代码不起作用。

  @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)

}

不知道为什么不回到之前的view controller,谢谢

最佳答案

您的父 View 是否嵌入到导航 Controller 中?还有 - View 是如何呈现的?

从您刚刚添加的帖子 - 您无法弹出模态 VC - 尝试关闭 View Controller 。

关于ios - popViewController 不返回,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31656147/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com