iOS应用程序崩溃,无法找到方案

时间:2018-03-05 09:02:24

标签: ios objective-c debugging

运行我的应用时,它崩溃了,而且我的代码没有看到错误。请帮我找到这个问题。

以下是didSelectRow中方法UITableViewDelegate中的代码,它崩溃了:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[[SingletonClass SharedMethod] setGlobalAddSubjectResueIdentifier:@"ForListDetails"];
[self.tblSearchHolder deselectRowAtIndexPath:[self.tblSearchHolder indexPathForSelectedRow] animated:YES];

NSDictionary *dictGGetSelectedVal=[arrLoadDataTemp objectAtIndex:indexPath.row];
[[SingletonClass SharedMethod] setGlobalSelectedSearchProperty:dictGGetSelectedVal];

arrGetValForTable=nil;
arrLoadDataTemp=nil;

[[SingletonClass SharedMethod] setGlobalHolder:@"addPropertyScene"];
[[NSNotificationCenter defaultCenter] postNotificationName:@"ChangeViewsAsPerCriteria" object:nil];

}

崩溃报告本身:

  

NSInvalidArgumentException:无法从nil请求创建任务

18  UIKit  0x18d7f8b20 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] (in UIKit) + 1352 
19  UIKit                               0x18d8a1760 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] (in UIKit) + 268
20  UIKit                               0x18d94faa8 _runAfterCACommitDeferredBlocks (in UIKit) + 292
21  UIKit                               0x18d942e5c _cleanUpAfterCAFlushAndRunDeferredBlocks (in UIKit) + 288
22  UIKit                               0x18d6d4464 _afterCACommitHandler (in UIKit) + 132
23  CoreFoundation                      0x1840cecdc __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ (in CoreFoundation) + 32
24  CoreFoundation                      0x1840cc694 __CFRunLoopDoObservers (in CoreFoundation) + 412
25  CoreFoundation                      0x1840ccc50 __CFRunLoopRun (in CoreFoundation) + 1292
26  CoreFoundation                      0x183fecc58 CFRunLoopRunSpecific (in CoreFoundation) + 436
27  GraphicsServices                    0x185e98f84 GSEventRunModal (in GraphicsServices) + 100
28  UIKit                               0x18d7455c4 UIApplicationMain (in UIKit) + 236
29  EnrichedValues                      0x100dd6cc8 0x100d80000 + 355528
30  libdyld.dylib                       0x183b0c56c start (in libdyld.dylib) + 4

1 个答案:

答案 0 :(得分:0)

好的,可以很容易地找到它(运气好的话:))。

  1. 首先,尝试按如下方式启用NSZombie对象:
  2. Step 1 Step 2

    1. 尝试按如下方式设置异常断点(确保您在断点的选项卡上):
    2. Step 3

      祝你好运&快乐的编码! :)