gpt4 book ai didi

xcode - 带有 Parse 的通知

转载 作者:行者123 更新时间:2023-11-30 13:35:11 24 4
gpt4 key购买 nike

我正在使用 Parse 创建(和删除)类似通知,并在我的控制台中收到此消息:喜欢2016-03-22 20:22:04.850 myapp [3081:645612] - [myapp.feedVC刷新:]:无法识别的选择器发送到实例0x7fd4db725300

我已经能够创建其他实例,其中通知在 Parse 中发送和更新正常,但由于某种原因,此通知给我带来了问题......不知道为什么。感谢您提前提供任何帮助或指导。

 let object = PFObject(className: "likes")
object["by"] = PFUser.currentUser()?.username
object["to"] = uuidLbl.text
object.saveInBackgroundWithBlock({ (success:Bool, error:NSError?) -> Void in
if success {
print("liked")
self.likeBtn.setTitle("like", forState: .Normal)
self.likeBtn.setBackgroundImage(UIImage(named: "like.png"), forState: .Normal)

// send notification if we like to refresh tableView
NSNotificationCenter.defaultCenter().postNotificationName("liked", object: nil)

// send notification as like
if self.usernameBtn.titleLabel?.text != PFUser.currentUser()?.username {
let newsObj = PFObject(className: "news")
newsObj["by"] = PFUser.currentUser()?.username
newsObj["ava"] = PFUser.currentUser()?.objectForKey("ava") as! PFFile
newsObj["to"] = self.usernameBtn.titleLabel!.text
newsObj["owner"] = self.usernameBtn.titleLabel!.text
newsObj["uuid"] = self.uuidLbl.text
newsObj["type"] = "like"
newsObj["checked"] = "no"
newsObj.saveEventually()
}
}
})

最佳答案

我会在您的代码库中搜索 refresh - 您自己在 feedVC 实例上调用刷新,或者 Parse 会为您执行此操作。

关于xcode - 带有 Parse 的通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36168246/

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