2012-05-25 40 views
1

我已经创建了一个应用程序使用基于选项卡的应用程序。通过在第一视图中选择一个按钮controller.xib第二视图controller.xib中的图像必须加载。我有第二个视图controller.xib但问题是如果我选择第一选项卡没有被加载。 这是我在firstview.controller.hxib加载但前一个视图控制器未加载?

@property (unsafe_unretained, nonatomic) IBOutlet UIButton *aboutus; 
- (IBAction)showabout:(id)sender; 

firstviewcontroller.m

- (IBAction)showabout:(id)sender { 
[[NSBundle mainBundle] loadNibNamed:@"SecondViewController" owner:self options:nil];} 

回答

0

代码试试这个:

- (IBAction)showabout:(id)sender 
{ 
SecondViewController *scv = [[SecondViewController alloc]initWithNibName:@"SecondViewController" bundle:nil]; 
[self.view addSubview:scv.view]; 
[scv release]; 
} 
+0

但如果我尝试这一点,说未声明的标识符 'SCV'。该怎么办?... – Dany

相关问题