0

最初にiPhoneアプリを作成しましたが、今はユニバーサルアプリに変更したいと考えています.変換する際に、ターゲットをユニバーサルに変更しました.Googleを調べたところ、ipad用に別のxibを作成する必要があることがわかりました.ユニバーサルにすると、iPad用のMainWindowを作成するように求められました。[はい]をクリックしました。アプリケーションの起動時にtabbarControllerを取得します。したがって、tabbarControllerにリンクされたiPad用のViewController.xibを作成しました。しかし、エラー [ 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 をクリックしてもアウトレットが見つかりませんか?

4

0 に答える 0