gpt4 book ai didi

ios - 提交给 Apple 的应用程序在本地运行与在 Apple 使用 Parse.com 后端运行不同

转载 作者:行者123 更新时间:2023-11-29 01:17:15 27 4
gpt4 key购买 nike

我希望其他开发人员在某个地方遇到过这个问题。我有一个应用程序,我一直在尝试获得 Apple 的批准。有趣的是,该应用程序在我的 iPhone 本地运行时和在 iOS 模拟器中运行时表现不同。具体来说,当新用户注册时,我会检查一个标志,看用户是否同意应用程序的条款和条件。在 Parse 中,列设置为 undefined,直到他们同意,然后它变为 true。这在我所有的测试中都很好用。但在 Apple,它不会也不会触发同意条款条件。这是该检查的代码:

if((PFUser.currentUser()!["termsAgreed"]) != nil) {
termsAgreed = PFUser.currentUser()!["termsAgreed"] as! Bool
if !termsAgreed {
self.performSegueWithIdentifier("agreeTerms", sender: nil)
}

}
else {
self.performSegueWithIdentifier("agreeTerms", sender: nil)

我做了一个新的更改,看看它是否有帮助,因为当用户注册时,我将 PFUser.currentUser()!["termsAgreed"] 设置为 false在此检查之前

我希望强制执行条款协议(protocol)条件在 Apple 端失败,但希望遇到类似情况的任何人提供一些反馈。

最佳答案

根据您的实际问题可能是什么,使用强制展开被认为不是很安全。你的代码会像这样更稳定:

if let termsAgreed = PFUser.currentUser()?["termsAgreed"] as? Bool where
!termsAgreed {
self.performSegueWithIdentifier("agreeTerms", sender: nil)
}
else {
// proceed
}

PS:我希望这在语法上是正确的——我手边没有 IDE。

关于ios - 提交给 Apple 的应用程序在本地运行与在 Apple 使用 Parse.com 后端运行不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35017789/

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