小编Chr*_*ler的帖子

单击远程通知后,应用程序无法打开

我有远程通知和OSx 10.8的问题.我启用了远程推送通知成功.它们也被发送到我的系统,但是当我尝试点击时,没有任何事情发生.此外,对于此应用更新,我必须启用沙盒!

Mac控制台日志:

29.08.12 11:03:50,600 usernoted[194]: Cannot find originating application to launch for event action.  file://localhost/Users/clueckler/Library/Developer/Xcode/DerivedData/mysms_OSX_Client-bcaianxrdhpztmdcnsrgzqdtqmvi/Build/Products/Debug/mysms_test.app/ is not the same app as the one that sent the original notification.
29.08.12 11:03:50,600 usernoted[194]: Error finding application com.mysms.osx.client.test.
Run Code Online (Sandbox Code Playgroud)

我认为这是AdHoc-Test的一个问题.所以我试着成功地将它提交给AppStore!但是AppStore版本出现了同样的问题(现在我从商店中删除了它......)

有这个问题的解决方案吗?

编辑(代码信息):

- (void)awakeFromNib { 
// Register app for remote notification 
[[NSApplication sharedApplication] registerForRemoteNotificationTypes:(NSRemoteNotificationTypeBadge | NSRemoteNotificationTypeSound | NSRemoteNotificationTypeAlert)]; 
} 

- (void)application:(NSApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { 
//Post token to server 
} 
Run Code Online (Sandbox Code Playgroud)

macos apple-push-notifications osx-mountain-lion

6
推荐指数
0
解决办法
412
查看次数

NSJSONSerialization - "字符串解析过程中意外的文件结尾"

我有一些问题有线解析一些REST的反应时.问题是,我不能复制.有时它会发生,我在错误日志中没有相应的信息.

Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (Unexpected end of file during string parse (expected low-surrogate code point
but did not find one).) UserInfo=0x157bddb0 {NSDebugDescription=Unexpected end of file during string parse (expected low-surrogate code point but did not find one).}
Run Code Online (Sandbox Code Playgroud)


对不起,由于敏感的用户数据,我不允许从JSON-Response中提供任何信息(它只出现在一些内部帐户中,其中错误日志级别设置为低以检测此问题).


其他一些信息:

  • JSON有效(通过http://jsonlint.com/查看)
  • 当试图重现这个问题,我让其他NSError说明,如:
    • 位置XYZ处的字符无效
    • 无效的对象
    • ...



UPDATE 1:解析机构(NSData的的扩展)

- (NSDictionary *)objectFromJSONDataWithError:(NSError **)error {
    NSDictionary *jsonObject = [NSJSONSerialization JSONObjectWithData: self
                                                               options: 0
                                                                 error: error];

    return jsonObject;
}
Run Code Online (Sandbox Code Playgroud)



更新2:用于下载数据的NSOperation - 主要()的内容 - …

json ios nsjsonserialization

2
推荐指数
1
解决办法
2932
查看次数