如何开始阅读这个iphone崩溃日志进行调试?

时间:2015-04-26 22:19:25

标签: ios xcode swift crash-reports

我在我的应用中发生了这次崩溃。 iOS noob在这里,甚至不知道从哪里开始调试这个。如何阅读此崩溃日志?哪个/哪个文件/功能是问题的开始?

2015-04-26 16:55:53.743 MyTestApp[10058:924348] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Can only call -[PFObject init] on subclasses conforming to PFSubclassing.'
*** First throw call stack:
(
0   CoreFoundation                      0x00000001032c6c65 __exceptionPreprocess + 165
1   libobjc.A.dylib                     0x0000000102f5fbb7 objc_exception_throw + 45  
2   CoreFoundation                      0x00000001032c6b9d +[NSException raise:format:] + 205
3   MyTestApp                            0x00000001014d8823 -[PFObject(Private) init] + 144
4   MyTestApp                            0x00000001014a91b0 _TTOFCSo8PFObjectcfMS_FT_S_ + 16
5   MyTestApp                            0x00000001014a7c67 _TFCSo8PFObjectCfMS_FT_S_ + 71
6   MyTestApp                            0x00000001014a1965 _TFC8MyTestApp22MessagesViewControllercfMS0_FT5coderCSo7NSCoder_S0_ + 213
7   MyTestApp                            0x00000001014a1a1d _TToFC8MyTestApp22MessagesViewControllercfMS0_FT5coderCSo7NSCoder_S0_ + 45
8   UIKit                               0x0000000103bc828b -[UIClassSwapper initWithCoder:] + 205
9   UIKit                               0x0000000103d19ab6 UINibDecoderDecodeObjectForValue + 705
10  UIKit                               0x0000000103d197ec -[UINibDecoder decodeObjectForKey:] + 276
11  UIKit                               0x0000000103bc7e84 -[UIRuntimeConnection initWithCoder:] + 153
12  UIKit                               0x0000000103d19ab6 UINibDecoderDecodeObjectForValue + 705
13  UIKit                               0x0000000103d19c85 UINibDecoderDecodeObjectForValue + 1168
14  UIKit                               0x0000000103d197ec -[UINibDecoder decodeObjectForKey:] + 276
15  UIKit                               0x0000000103bc7327 -[UINib instantiateWithOwner:options:] + 990
16  UIKit                               0x0000000103e29aba -[UIStoryboard instantiateViewControllerWithIdentifier:] + 181
17  MyTestApp                            0x000000010148b406 _TFC8MyTestApp22OverviewViewController9tableViewfS0_FTCSo11UITableView23didSelectRowAtIndexPathCSo11NSIndexPath_T_ + 246
18  MyTestApp                            0x000000010148bbff _TToFC8MyTestApp22OverviewViewController9tableViewfS0_FTCSo11UITableView23didSelectRowAtIndexPathCSo11NSIndexPath_T_ + 79
19  UIKit                               0x00000001039e0dc9 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1293
20  UIKit                               0x00000001039e0f0a -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 219
21  UIKit                               0x000000010391362c _applyBlockToCFArrayCopiedToStack + 314
22  UIKit                               0x00000001039134a6 _afterCACommitHandler + 533
23  CoreFoundation                      0x00000001031f9ca7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
24  CoreFoundation                      0x00000001031f9c00 __CFRunLoopDoObservers + 368
25  CoreFoundation                      0x00000001031efa33 __CFRunLoopRun + 1123
26  CoreFoundation                      0x00000001031ef366 CFRunLoopRunSpecific + 470
27  GraphicsServices                    0x0000000105032a3e GSEventRunModal + 161
28  UIKit                               0x00000001038ef900 UIApplicationMain + 1282
29  MyTestApp                            0x000000010149f137 main + 135
30  libdyld.dylib                       0x0000000108ac6145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

1 个答案:

答案 0 :(得分:1)

崩溃的原因在第一行:

  

原因:'只能在符合的子类上调用 - [PFObject init]   PFSubclassing'。

这意味着您的子类继承自PFObject但不符合协议PFSubclassing。因此,无法在子类上调用init。

<强>实施例

@interface MyPFSubclass : PFObject

应替换为:

@interface MyPFSubclass : PFObject <PFSubclassing>

有关解释堆栈跟踪的更多信息,我建议使用本教程:My App Crashed, Now What? – Part 1