我正在使用Parse创建(和删除)通知,并在我的控制台中收到此消息:like 2016-03-22 20:22:04.850 myapp [3081:645612] - [myapp.feedVC refresh:]:无法识别的选择器发送到实例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() } } })I am creating (and deleting) like notifications with Parse and am getting this message in my console: liked 2016-03-22 20:22:04.850 myapp[3081:645612] -[myapp.feedVC refresh:]: unrecognized selector sent to instance 0x7fd4db725300
I have been able to create other instances where the notifications are sending and updating fine in Parse but for some reason this notification is giving me problems...no idea why. Thanks for any help or direction in advance.
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的实例上调用refresh,要么Parse正在为您执行此操作。
I'd search your codebase for refresh - either you're calling refresh on an instance of feedVC yourself, or Parse is doing it for you.
更多推荐
发布评论