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

问题描述 投票:0回答:1

运行我的应用程序时,它崩溃,我没有看到我的代码有问题。请帮我找到这个问题。

这是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
ios objective-c debugging
1个回答
0
投票

好吧,它很容易找到(有点运气:))。

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

Step 1 Step 2

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

Step 3

祝你好运,编码愉快! :)

© www.soinside.com 2019 - 2024. All rights reserved.