- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我在 application:didFinishLaunchingWithOptions 中保存一个 PFInstallation 对象——我不是询问用户推送权限或任何与 deviceToken 相关的事情——我发现许多标准字段未填充,包括:
(这些列在数据浏览器中未定义,不会显示在 PFInstallation 对象的 NSLog 上。)
我正在抓取并成功将 deviceModel 和 deviceOS 保存到两个自定义列中。但我对为什么上述列未定义感到有点困惑。
代码如下:
[Parse setApplicationId:PARSE_APPID_DEV
clientKey:PARSE_CLIENTKEY_DEV];
// record device model and OS
NSString *model = [self getDeviceModelAndNumber]; // via sys/utsname.h
NSString *sysVersion = [[UIDevice currentDevice] systemVersion];
PFInstallation *currentInstallation = [PFInstallation currentInstallation];
PFUser *loggedUser = [PFUser currentUser];
if (loggedUser)
[currentInstallation setObject:loggedUser forKey:@"user"];
[currentInstallation setObject:model forKey:@"deviceModel"];
[currentInstallation setObject:sysVersion forKey:@"deviceOS"];
NSLog(@"installation: %@", currentInstallation);
[currentInstallation saveInBackground];
这个项目是在 Xcode 6 中创建的。在一个不同的项目中,在 Xcode 5 中创建,我基本上做同样的事情,并且正确地填充和保存了列。
还有其他人遇到过这个吗?我用谷歌搜索了很多但没有找到解决方案。非常感谢任何帮助。
最佳答案
经过多次实验,似乎(显着地)将最后一行更改为
[currentInstallation saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
// some logging code here
}];
解决问题。所以我想我应该用 Parse 提交一个错误。 (其实已经有一个打开了:https://developers.facebook.com/bugs/712949858787516/)
关于ios - 保存 Parse PFInstallation 对象时缺少字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26691295/
我正在尝试将 BOOL 值写入 PFInstallation 中的列,但会不停地崩溃: - (IBAction)pushSwitch:(id)sender { NSUserDefaults *push
我不熟悉在 Parse 上使用 PFinstallations,我对它们的工作方式有点困惑。我有一个应用程序可以在用户创建帐户时创建新安装,我将安装的“用户”字段设置为用户 userId,以便稍后可以
我们是否能够强制清除 PFInstallation 数据? 当我想强制注销用户时需要它来重新创建另一个 PFInstallation。 当前问题:新帐户正在使用旧帐户的 PFInstallation,
所以我正在尝试进行自定义通知管理,如果应用程序在后台,一切正常,但如果用户在应用程序中收到通知,则当前安装似乎没有更新以反射(reflect)解析中的内容,我试过获取,但似乎没有更新,只是返回局部变量
我正在尝试掌握 Parse 并构建一个简单的聊天应用程序。对于我的登录 和注册 代码,我有以下代码段: PFInstallation *installation = [PFInstallation c
这可能是个愚蠢的问题,但我想确保更改 PFInstallation.currentInstallation().channels 只会影响当前设备订阅,而不影响全局 channel 。 我基本上想验证
调用 PFInstallation.currentInstallation().fetchInBackgroundWithBlock 时出现以下错误。 2015-07-31 07:12:13.944
我在 application:didFinishLaunchingWithOptions 中保存一个 PFInstallation 对象——我不是询问用户推送权限或任何与 deviceToken 相关
我正在为我的第一个应用程序设置推送通知,但在 Parse 上的 PFInstallation 中向我的 channel 数组添加更多 channel 时遇到问题。到目前为止,我已经添加了 2 个工作正
我正在尝试从 PFInstallation 添加/删除 channel ,但我不断收到相同的错误消息: Terminating app due to uncaught exception 'NS
如果用户最喜欢的食物之一出现在某一天的餐饮菜单上,我会尝试向用户发送推送通知。例如,如果用户将比萨饼、意大利面和土 bean 列为他最喜欢的食物,并且在特定的一天,菜单包含比萨饼,则用户将收到推送通知
我正在尝试将订阅添加到特定 PFUser 的所有 PFInstallations(对于一个人在 iPhone iPad 等上使用相同登录的情况)。我有他们所有使用该应用程序的 Facebook 好友的
当用户登录时,我希望将 PFInstallation“用户名”属性设置为一个字符串,以便用户的 Parse.Installation 对象在 Parse 服务器上具有相同字符串的“用户名”属性。 当我
我正在使用 Parse 和 PFInstallation 根据来自 Parse 的通知增加我的应用程序的角标(Badge)计数。我还需要能够减少该数字——而不仅仅是重置它;我正在寻找与 iOS 消息或
我正在使用下面的代码来获取用户,但我无法获取它。应用程序崩溃了......请帮助我获取所有安装对象列表。 PFQuery *userQuery = [PFQuery queryWithClassNam
我目前无法让 Parse(推送通知服务)在现有的 iOS 应用程序上运行。具体来说,[PFInstallation currentInstallation] 总是返回一个 nil 值。在我的 didF
我想知道用户是否可以读取/写入解析安装类中不属于其设备的行? 我尝试 PFInstallation.query() 和 PFQuery(className: "Installation") 查询安装类
我能否通过用户 ID 获取 PFInstallation 对象,以便我可以订阅该安装的 channel 。 [PFInstallation currentInstallation] 仅提供该设备的安装
我是一名优秀的程序员,十分优秀!