본문 바로가기

개발도구/iOS - 아이폰 개발

[아이폰] storyboard identifier


Modal 방식

 아래 것들로 해보다가 안되어 그냥 로그차원에 남겨둡니다.

 보아 하니 tabbarcontroller에 view을 상속하고 있는거 같군요..  하여튼 모르면 고생

두세시간 만에 해결하여 기분이 좋습니다. !!

    UIStoryboard *sb = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil];

    UIViewController *vc = [sb instantiateViewControllerWithIdentifier:@"TabBarController"]; // tabbarcontroller ID값 (ID값은 stroyboard에서 설정함 - 아래 그림처럼 !)

    [self presentModalViewController:vc animated:YES];      

                 

storyboard 에

 identifier 에 고유값을 작성해야 찾아 들어갈수 있다.





/* -------------------에러 로그인 그냥 기록 차원에서 남겨둠.. 사용하지 마세요 에러 남니다-------------------

        SecondViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"TabBarController"];       

        vc.modalPresentationStyle = UIModalPresentationPageSheet;        

        [self presentModalViewController:vc animated:YES];        

        [vc release];

*/

/*

    UITabBarController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"TabBarController"];       

    vc.modalPresentationStyle = UIModalPresentationPageSheet;        

    [self presentModalViewController:vc animated:YES];        

    [vc release];

    */

  

    /*

    UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle: nil];

    UITabBarController *controller = (UITabBarController*)[mainStoryboard instantiateViewControllerWithIdentifier: @"TabBarController"];    

    controller.modalPresentationStyle = UIModalPresentationPageSheet;        

    [self presentModalViewController:controller animated:YES];        

    [controller release];

    */

    

    /*

    UIViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"TabBarController"];

    controller.modalPresentationStyle = UIModalPresentationPageSheet;        

    [self presentModalViewController:controller animated:YES];        

    [controller release];

     -------------------------------------------------------------------------------------------------------*/