Ios Swift,Parse currentInstallation()-不同视图上的输出通道

Ios Swift,Parse currentInstallation()-不同视图上的输出通道,ios,swift,parse-platform,Ios,Swift,Parse Platform,我正在使用parse.com推送通知 在一个视图中,用户可以订阅通知。我使用: let currentInstallation = PFInstallation.currentInstallation() currentInstallation.addUniqueObject(self.gameID, forKey: "channels") currentInstallation.saveInBackground() 我输出通道: print(currentIn

我正在使用parse.com推送通知

在一个视图中,用户可以订阅通知。我使用:

    let currentInstallation = PFInstallation.currentInstallation()
    currentInstallation.addUniqueObject(self.gameID, forKey: "channels")
    currentInstallation.saveInBackground()
我输出通道:

    print(currentInstallation.channels as! [String])
很好!输出当前订阅的频道

现在,从另一个角度来看,我也有同样的想法

    let currentInstallation = PFInstallation.currentInstallation()

还有打印声明。但是,print语句返回nil。你知道如何在另一个视图中,我也可以获得当前订阅频道的列表吗?

听起来像是一个奇怪的错误。也许在你的第二个视图的其他地方有一个错误。如果在第二个视图中获取数据,比如PFInstallation.currentInstallation().fetchifneededInBackgroundithBlock({(currentInstallation,error)->Void in})如果我打印出那条语句,我会得到
()
-这就是你的意思吗?嗯,不,我是说,将此代码复制到第二个视图中。PFInstallation.currentInstallation().FetchInBackgroundithBlock({(currentInstallation,error)->Void in let currentInstallation=PFInstallation.currentInstallation()打印(currentInstallation.channels as![String]))成功!所以区别在于。。。你从parse.com取回数据而不是使用我的应用程序的数据?谢谢是的,但奇怪的是,本地安装没有保存自己。我的解决方案可能是掩盖一个潜在的bug。