这是我的第一篇文章,谢谢,你很有帮助。但我被困住了。我试图实现:xcode init controller with data
当我用新参数初始化控制器时,我得到:没有可见的@interface for 'VisiteViewController' 声明选择器'initWithNibName:bundle:texte:'
在 VisiteViewController.m 我有:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil texte:(NSString *)chaine{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;}
我这样称呼它:
- (IBAction)goToVisite: (id)sender{
NSLog(@"Button pushed");
VisiteViewController *visiteViewController = [[VisiteViewController alloc] initWithNibName:@"VisiteViewController" bundle:nil texte:@"lkj"];
[self.navigationController pushViewController:visiteViewController animated:YES];
}
谢谢你的帮助