Parse的通知(Notifications with Parse)

编程入门 行业动态 更新时间:2024-10-26 12:26:24
Parse的通知(Notifications with Parse)

我正在使用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.

更多推荐

本文发布于:2023-08-05 23:09:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1440112.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:通知   Parse   Notifications

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!