我在开始时创建了一个 iphone 应用程序。但现在我想将其更改为通用应用程序。在转换它时,我已将目标更改为通用。通过 google 并发现我必须为 ipad 创建不同的 xib。当我更改为它是通用的,它要求我为 ipad 创建一个 MainWindow。我单击是。现在在我的应用程序启动时,我得到了一个 tabbarController。所以我为 ipad 创建了一个 ViewController.xib,它在 tabbarController 中链接。但是我收到错误 [ setValue:forUndefinedKey:]: 这个类不符合键委托的键值编码。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
ViewController *first=[[ViewController alloc]
initWithNibName:@"ViewController-iPad" bundle:nil] ;
Login *second=[[Login alloc]initWithNibName:@"Login" bundle:nil];
second.title=@"Login";
NSArray *viewArray=[[NSArray alloc] initWithObjects: first,second,nil];
UITabBarController *tabBarController1=[[UITabBarController alloc] init];
[tabBarController1 setViewControllers:viewArray animated:NO];
for(UIViewController *tab in tabBarController1.viewControllers)
{
[tab.tabBarItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:16.0], UITextAttributeFont, nil]
forState:UIControlStateNormal];
}
[self.window addSubview:tabBarController1.view];
[self.window makeKeyAndVisible];
CGRect rect = [[UIScreen mainScreen] bounds];
[self.window setFrame:rect];
[viewArray release];
[first release];
[second release];
return YES;
}
else
{
//code to load tabbarController for iphone xib's
在哪里链接?当我单击 FilesOwner 时,我没有找到任何网点?