【发布时间】:2010-05-31 09:50:22
【问题描述】:
我试图在我的 iPhone 应用程序中的视图控制器之间切换视图,但它崩溃了。 基本上我是从 mainScreen 切换到 test。
我在调试器中遇到错误:
0x01d6a000 <+0000> push %ebp
0x01d6a001 <+0001> mov %esp,%ebp
0x01d6a003 <+0003> int3
0x01d6a004 <+0004> leave (HIGHLIGHTED)
0x01d6a005 <+0005> ret
0x01d6a006 <+0006> nopw %cs:0x0(%eax,%eax,1)
mainscreen.h
#import <UIKit/UIKit.h>
@interface MainScreen : UIViewController {
}
-(IBAction)btnFirstPage:(id)sender;
@end
mainscreen.m
#import "MainScreen.h"
#import "test.h"
@implementation MainScreen
-(IBAction)btnFirstPage:(id)sender{
test1 = [[test1 alloc]
initWithNibName:@"test" (test may not respond to -alloc)
bundle:nil];
[self.view addSubview:test1.view];
/* etc. */
test.h
#import <UIKit/UIKit.h>
@interface test : UIViewController {
}
@end
【问题讨论】:
标签: iphone objective-c uncaught-exception