2015-04-26 40 views
-1

我有這個崩潰發生在我的應用程序。 iOS noob在這裏,甚至不知道從哪裏開始調試。如何閱讀這個崩潰日誌?哪裏/哪個文件/功能是問題的出發點?如何甚至開始閱讀這個iphone崩潰日誌來調試?

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) 
+3

的原因崩潰是在第一行:原因:「只能調用 - 符合PFSubclassing的子類上的[PFObject init]。'您的子類必須從PFObject繼承,但不符合協議PFSubclassing。 – Jonathan

+0

謝謝,幫助我,我能夠用打印語句調試問題。我想我需要更多地瞭解這些崩潰日誌,可以將你的標記作爲答案。 – user1406716

+0

對!我很高興這有幫助。我會發佈一個答案。 – Jonathan

回答

1

的原因崩潰是在第一行:

原因: '只能調用 - [PFObject的init]對符合 PFSubclassing子類。'

這意味着您的子類繼承PFObject但不符合協議PFSubclassing。因此,init不能在你的子類上調用。

Ex。

@interface MyPFSubclass : PFObject 

應改爲:

@interface MyPFSubclass : PFObject <PFSubclassing> 

欲瞭解更多信息,解釋堆棧跟蹤我建議這個教程:My App Crashed, Now What? – Part 1