【发布时间】:2011-12-26 14:01:42
【问题描述】:
我正在使用 sdk 5 和 Storyboard 开发一个 iPad 应用程序,该应用程序来自一个已经工作的 iPhone 应用程序(使用单独的 xibs 开发)。我了解情节提要的工作原理,但我想推送带有参数的视图控制器。按钮调用 logIn2 操作,如:
- (IBAction)logIn2: (NSString *)strUser: (NSString *)strPass
{
userViewController *UserViewController = [[userViewController alloc] initWithNibName:@"userViewController" bundle:nil stringOne:strUser stringTwo:strPass];
//UserViewController.hidesBottomBarWhenPushed = YES;
[[self navController] pushViewController:UserViewController animated:YES];
}
这工作正常,但使用 sdk 5 在第一行返回错误。如何通过参数推送视图?谢谢。
【问题讨论】:
-
错误:接收器类型 'userViewController' 例如消息未使用选择器 'initWithNibName:bundle:stringOne:stringTwo:' 声明方法 [4]
标签: objective-c cocoa-touch ios5 uikit xcode-storyboard