Ios 是什么导致我的EXC\u访问不良?(iPhone SDK)
是什么导致我的EXC无法访问 每次它加载登录时,每当我按下该页面上的按钮或其他东西时,它就会崩溃Ios 是什么导致我的EXC\u访问不良?(iPhone SDK),ios,xcode,uinavigationcontroller,Ios,Xcode,Uinavigationcontroller,是什么导致我的EXC无法访问 每次它加载登录时,每当我按下该页面上的按钮或其他东西时,它就会崩溃 - (IBAction)startSignin:(id)sender { Login *aview = [[Login alloc] init]; aview.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [self.navigationController presentModalViewContro
- (IBAction)startSignin:(id)sender {
Login *aview = [[Login alloc] init];
aview.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self.navigationController presentModalViewController:aview animated:YES];
[_window addSubview:aview.view];
[aview release];
}
这通常是由于在对象释放后访问该对象而导致的。这也是您熟悉调试器的一个好方法。在按钮操作方法的第一行上设置断点,并逐步通过它找出哪一行是坏的
这一次,我怀疑是您调用了
addSubview:
,presentModal…
将负责显示视图。您可以发布崩溃时的堆栈跟踪吗?argc int 1 argv char**0xbfff664 pool NSAutoreleasePool*0x4b53d60 retVal int-1073744276-就是这个吗?我不知道在哪里可以找到堆栈跟踪…它在调试器视图中。这将是导致您崩溃的嵌套调用系列。是的,它不会显示视图,因此我必须添加子视图如果presentModal…没有显示任何我怀疑的内容view==nil,或者它没有连接到nib文件中,或者它不是由loadView
创建的(但是您正计划这样做),您确认该视图==nil了吗?
*** Call stack at first throw:
(
0 CoreFoundation 0x00dc25a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f16313 objc_exception_throw + 44
2 CoreFoundation 0x00d7aef8 +[NSException raise:format:arguments:] + 136
3 CoreFoundation 0x00d7ae6a +[NSException raise:format:] + 58
4 UIKit 0x000c6709 -[UIViewController _loadViewFromNibNamed:bundle:] + 295
5 UIKit 0x000c4134 -[UIViewController loadView] + 120
6 UIKit 0x000c400e -[UIViewController view] + 56
7 UIKit 0x00037d42 -[UIWindow addRootViewControllerViewIfPossible] + 51
8 Test 0x00001b3c -[TestAppDelegate application:didFinishLaunchingWithOptions:] + 220
9 UIKit 0x00014c89 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1163
10 UIKit 0x00016d88 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 439
11 UIKit 0x00021617 -[UIApplication handleEvent:withNewEvent:] + 1533
12 UIKit 0x00019abf -[UIApplication sendEvent:] + 71
13 UIKit 0x0001ef2e _UIApplicationHandleEvent + 7576
14 GraphicsServices 0x00ffb992 PurpleEventCallback + 1550
15 CoreFoundation 0x00da3944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
16 CoreFoundation 0x00d03cf7 __CFRunLoopDoSource1 + 215
17 CoreFoundation 0x00d00f83 __CFRunLoopRun + 979
18 CoreFoundation 0x00d00840 CFRunLoopRunSpecific + 208
19 CoreFoundation 0x00d00761 CFRunLoopRunInMode + 97
20 UIKit 0x000167d2 -[UIApplication _run] + 623
21 UIKit 0x00022c93 UIApplicationMain + 1160
22 Test 0x00001a29 main + 121
23 Test 0x000019a5 start + 53
)
terminate called throwing an exceptionCurrent language: auto; currently objective-c