gpt4 book ai didi

iphone - 调试崩溃报告

转载 作者:行者123 更新时间:2023-12-03 16:56:18 25 4
gpt4 key购买 nike

突然间,我的应用程序开始崩溃。我得到了以下信息

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000010f8b9f0
Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Application Specific Information:
objc_msgSend() selector name: release
iPhone Simulator 235, iPhone OS 4.2 (iPhone/8C134)

Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x01223a63 objc_msgSend + 23
1 CoreFoundation 0x00fd8a6c CFRelease + 92
2 CoreFoundation 0x010ba8ca -[__NSArrayI dealloc] + 170
3 CoreFoundation 0x00fd8a6c CFRelease + 92
4 CoreFoundation 0x00ffdb8d _CFAutoreleasePoolPop + 237
5 Foundation 0x00056738 -[NSAutoreleasePool drain] + 167
6 CFNetwork 0x0168c606 URLConnectionClient::_clientDidFinishLoading(URLConnectionClient::ClientConnectionEventQueue*) + 220
7 CFNetwork 0x01757821 URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent, XClientEventParams>*, long) + 293
8 CFNetwork 0x01757b0f URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent, XClientEventParams>*, long) + 1043
9 CFNetwork 0x01682e3c URLConnectionClient::processEvents() + 100
10 CFNetwork 0x01682cb7 MultiplexerSource::perform() + 251
11 CoreFoundation 0x010a301f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
12 CoreFoundation 0x0100128b __CFRunLoopDoSources0 + 571
13 CoreFoundation 0x01000786 __CFRunLoopRun + 470
14 CoreFoundation 0x01000240 CFRunLoopRunSpecific + 208
15 CoreFoundation 0x01000161 CFRunLoopRunInMode + 97
16 GraphicsServices 0x0198d268 GSEventRunModal + 217
17 GraphicsServices 0x0198d32d GSEventRun + 115
18 UIKit 0x0030c42e UIApplicationMain + 1160
19 i-Referral 0x00002582 main + 84 (main.m:53)
20 i-Referral 0x00002525 start + 53

如果我在 Zombie 开启的情况下运行“分配”,一切正常,但是没有引发任何标志。

它在 NSURLRequest 坐在 App 委托(delegate)中后崩溃。任何的想法?

在 connectionDidFinishLoading: 方法中我只调用解析。一个数组被创建并释放。

当应用程序崩溃时,它并没有那么远。

当应用程序第一次在这里启动时,事件序列:
设置 nsurl,
conn收到回复,
conn收到数据,
连接完成加载,
解析开始...

当崩溃发生时,我在应用程序委托(delegate)中调用一个方法,它会转到
设置 nsurl,
然后崩溃永远不会到达 conn 收到的响应
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{


NSXMLParser *responseParser = [[NSXMLParser alloc] initWithData:provListData];
responseParser.delegate = self;
[responseParser parse];
[responseParser release];



}

我认为是推新 Controller 造成的崩溃。

这就是我所拥有的。登录 View -> 注册 View

如果注册完成,将显示一个新页面仪表板。它将通过成为 Root View Controller 来替换登录和注册页面。

我有这个工作,但某处发生了变化。

我在成功登录时做同样的事情,效果很好。

在里面
UINavigationController *localNavigationController;
tabBarController = [[UITabBarController alloc] init];
NSMutableArray *localControllersArray = [[NSMutableArray alloc] initWithCapacity:3];


ProviderListViewController *firstViewController;
firstViewController = [[ProviderListViewController alloc] initWithTabBar];
localNavigationController = [[UINavigationController alloc]
initWithRootViewController:firstViewController];

[localControllersArray addObject:localNavigationController];
[localNavigationController release];
[firstViewController release];



Login *signupViewController;
signupViewController = [[Login alloc] initWithTabBar];
localNavigationController = [[UINavigationController alloc]
initWithRootViewController:signupViewController];

[localControllersArray addObject:localNavigationController];
[localNavigationController release];
[signupViewController release];


SecondViewController *secondViewController;
secondViewController = [[SecondViewController alloc] initWithTabBar];
localNavigationController = [[UINavigationController alloc]
initWithRootViewController:secondViewController];

[localControllersArray addObject:localNavigationController];
[localNavigationController release];
[secondViewController release];


tabBarController.viewControllers = localControllersArray;

[self.window addSubview:tabBarController.view];

[self.window makeKeyAndVisible];

[localControllersArray release];

推新 Controller
AppDelegate  *appd = [[AppDelegate alloc]init];
[appd gotConnection];
[appd release];



UINavigationController *navcont = self.navigationController;
[self retain];
Dashboard *third = [[Dashboard alloc] initWithNibName:@"Dashboard" bundle:nil];
NSArray *newarray = [NSArray arrayWithObjects:third,nil,nil];
[navcont setViewControllers:newarray animated:YES];
[third release];

最佳答案

看起来您正在发送 release发送给 connectionDidFinishLoading: 中已释放实例的消息方法。检查内存管理调用是否平衡。

关于iphone - 调试崩溃报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6399841/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com