我正在成功地将一些数据添加到我的解析类(表)中。
保存成功后(我可以在网站上看到数据),我的应用程序崩溃了,控制台上没有留下任何消息。我试图通过使用“启用僵尸对象”设置来获取消息。这是我收到的消息,与我正在做的事情无关:
-[UIActivityIndicatorView release]: message sent to deallocated instance 0x126d16780
我的整个项目中没有任何UIActivityIndicatorView
。
这是我保存数据的方式:
var currentUser = PFUser.currentUser()!
var userCase = PFObject(className: "Case")
userCase.relationForKey("user").addObject(currentUser)
userCase["caseCode"] = "test_code"
userCase.saveInBackgroundWithBlock {
(success: Bool, error: NSError?) -> Void in
if (success) {
// The object has been saved.
println("saved")
} else {
// There was a problem, check error.description
println("error occurred: \(error?.description)")
}
}
Swift SDK 版本:1.7.5 Xcode 版本:6.4
有没有人遇到过这样的问题?
更新:此错误不会在模拟器上发生(在 iPhone 5、iPhone 5S、iPhone 6 上测试过),也不会在设备首次运行时发生。
尝试删除并重新安装该应用。
更新 2: 从 AppDelegate 中删除 PFFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions)
或将其更改为 PFFFacebookUtils.initialize()
可以解决问题,但我我想我需要使用 initializeFacebookWithApplicationLaunchOptions(launchOptions)
。我现在有另一个问题。
最佳答案
您可以执行以下操作。
1) Go to PFFacebookUtils.h
2) change:
(void)initializeFacebookWithApplicationLaunchOptions:(NSDictionary *)launchOptions;
To:
(void)initializeFacebookWithApplicationLaunchOptions:(PF_NULLABLE NSDictionary *)launchOptions;
最初发布于here
关于ios - 解析 saveInBackgroundWithBlock 在 iOS 上崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31393938/