Использование необъявленного идентификатора — Objective C

Прежде всего, я новичок в Objective C. Я хотел разработать свое первое приложение, и я хочу использовать 2 разные раскадровки. Один для iPhone 4/4S и один для размера экрана iPhone 5. Я нашел действительно хороший код от lionserdar в Как переключиться на другой Раскадровка для iPhone 5?

Моя проблема в том, что когда я добавляю код в свой AppDelegate.m, у меня возникает эта проблема;

"Использование необъявленного идентификатора "InitializeStoryBoardBasedOnScreenSize"

И я не знаю, как это исправить. Спасибо уже.

-(void)initializeStoryBoardBasedOnScreenSize {
    if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) { // The iOS device = iPhone or iPod Touch

        CGSize iOSDeviceScreenSize = [[UIScreen mainScreen] bounds].size;

        if (iOSDeviceScreenSize.height == 480)
        {   // iPhone 3GS, 4, and 4S and iPod Touch 3rd and 4th generation: 3.5 inch screen (diagonally measured)

            // Instantiate a new storyboard object using the storyboard file named Storyboard_iPhone35
            UIStoryboard *iPhone35Storyboard = [UIStoryboard storyboardWithName:@"Storyboard_iPhone35" bundle:nil];

            // Instantiate the initial view controller object from the storyboard
            UIViewController *initialViewController = [iPhone35Storyboard instantiateInitialViewController];

            // Instantiate a UIWindow object and initialize it with the screen size of the iOS device
            self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

            // Set the initial view controller to be the root view controller of the window object
            self.window.rootViewController  = initialViewController;

            // Set the window object to be the key window and show it
            [self.window makeKeyAndVisible];
       }

       if (iOSDeviceScreenSize.height == 568)
       {   // iPhone 5 and iPod Touch 5th generation: 4 inch screen (diagonally measured)

           // Instantiate a new storyboard object using the storyboard file named Storyboard_iPhone4
           UIStoryboard *iPhone4Storyboard = [UIStoryboard storyboardWithName:@"Storyboard_iPhone4" bundle:nil];

           // Instantiate the initial view controller object from the storyboard
           UIViewController *initialViewController = [iPhone4Storyboard instantiateInitialViewController];

           // Instantiate a UIWindow object and initialize it with the screen size of the iOS device
           self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

           // Set the initial view controller to be the root view controller of the window object
           self.window.rootViewController  = initialViewController;

           // Set the window object to be the key window and show it
           [self.window makeKeyAndVisible];
       }

   } else if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad)

   {   // The iOS device = iPad

       UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
       UINavigationController *navigationController = [splitViewController.viewControllers lastObject];
       splitViewController.delegate = (id)navigationController.topViewController;

   }
}

person user2062381    schedule 11.02.2013    source источник
comment
Вы пишете код в блокноте? В XCode есть автозаполнение (intellisense), вам не следует нажимать на эти вещи. Не пишите ничего вручную!   -  person Ahmet Alp Balkan    schedule 11.02.2013
comment
Покажите код, где вы пытаетесь вызвать этот метод. Вы вызываете его из AppDelegate.m или какого-то другого файла? Если из другого файла, вы добавили объявление в файл .h?   -  person rmaddy    schedule 11.02.2013
comment
Может быть, вы должны сказать нам, какая строка помечена этой ошибкой.   -  person Hot Licks    schedule 11.02.2013
comment
(Знаете ли вы, как писать на старом добром C? Это простая ошибка неопределенного символа, с которой любой студент, изучающий программирование, должен знать, как справиться со вторым классом.)   -  person Hot Licks    schedule 11.02.2013


Ответы (1)


заглавная буква «I», отличающаяся InitializeStoryBoardBasedOnScreenSize от InitializeStoryBoardBasedOnScreenSize?

person Bruno Koga    schedule 11.02.2013
comment
Неа. Пробовал оба. Все еще с той же проблемой - person user2062381; 11.02.2013