突然我的應用程序開始崩潰。我一直得到以下調試崩潰報告
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
如果我運行「分配」與殭屍開啓一切工作正常但沒有標誌成立。
它在坐在App委託中的NSURLRequest後崩潰。任何想法?
在connectionDidFinishLoading:方法中,我只調用解析。一個數組被創建併發布。
當應用程序崩潰它沒有得到那麼多。
當應用程序第一次啓動此事件的順序: 集NSURL, 康涅狄格州收到的響應, 康恩接收到的數據, 連接完成加載,解析 開始......
當崩潰發生我調用應用程序委託中的方法它去 集NSURL, ,然後崩潰永遠不會到達康涅狄格州收到的響應
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
NSXMLParser *responseParser = [[NSXMLParser alloc] initWithData:provListData];
responseParser.delegate = self;
[responseParser parse];
[responseParser release];
}
我認爲造成PU崩潰重新控制新的控制器。
這是我的。登錄視圖 - >註冊視圖
如果註冊完成一個新頁面儀表盤將顯示。它將通過成爲根視圖控制器來替換登錄和註冊頁面。
我有這個工作,但有些地方改變了。
我在成功登錄時做了同樣的事情,並且工作正常。
初始化
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];
推新控制器
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];
如果可能的話,在這裏添加委託方法?你正在發佈一個數組?如果是這樣,你如何添加對象到該數組? –
你可以添加'connectionDidFinishLoading:'方法嗎? –
什麼是AppDelegate?你爲什麼要保留「自我」? –