Ios 来自PFObject的密钥导致崩溃--Parse.com
我试图从Ios 来自PFObject的密钥导致崩溃--Parse.com,ios,objective-c,crash,Ios,Objective C,Crash,我试图从PFObject的子类中检索字符串,如下所示: NSLog(@"Name: %@", _post.repost.group.name); NSString *dateAuthor = [NSString stringWithFormat:@"%@ from group @%@", [_post.repost.createdAt timeAgo], _post.group.name]; 正在获取以下日志: 2014-05-29 19:39:55.243 Bevy2[1966:6
PFObject
的子类中检索字符串,如下所示:
NSLog(@"Name: %@", _post.repost.group.name);
NSString *dateAuthor = [NSString stringWithFormat:@"%@ from group @%@", [_post.repost.createdAt timeAgo], _post.group.name];
正在获取以下日志:
2014-05-29 19:39:55.243 Bevy2[1966:60b]BevyTeam
2014-05-29
19:41:02.407 Bevy2[1966:60b]*由于未捕获而终止应用程序
异常“NSInternalInconsistencyException”,原因:'Key“name”已
没有数据。在获取其值之前调用FetchIfRequired。'
*第一次抛出调用堆栈:(0x2fbf1f0b 0x3a388ce7 0x2fbf1e4d 0xbfabf 0xc2e69 0x451a7 0x412e9 0x32554199 0x324fb3fb 0x324fac51 0x32421305
0x3209d31b 0x32098b3f 0x320989d1 0x320983e5 0x320981f7 0x32091f1d
0x2fbbd039 0x2fbba9c7 0x2fbbad13 0x2fb25769 0x2FB254B 0x34a926d3
0x32484891 0x4b9c9 0x3a886ab7)libc++abi.dylib:终止于
NSException(lldb)类型的未捕获异常
如您所见,\u post.repost.group.name
确实返回字符串。然而,一旦我到达第二行,应用程序就会因错误而崩溃
有没有人知道为什么会发生这种情况?谢谢 在你写的第二行:
_post.group.name
而不是:
_post.repost.group.name
享受;) 啊,开枪。有时候是一些小事让你。。。谢谢