ProgramingTip

iOS5 Storyboard UIViewController 어떤 init 메소드가 스토리 보드에서 호출?

bestdevel 2020. 10. 12. 07:54
반응형

iOS5 Storyboard UIViewController 어떤 init 메소드가 스토리 보드에서 호출?


어떤 init을위한 방법은 스토리 보드에 의해 호출되는 UIViewControllers스토리 보드에 추가?


사용 된 이니셜 라이저는 initWithCoder:

- (id)initWithCoder:(NSCoder *)decoder

그런 다음 나중에 awakeFromNib메시지 도 표시 됩니다.


나는 그것을 믿는다 awakeFromNib


그것은 - (id)initWithCoder:(NSCoder *)decoder

따라서 사용자 지정 초기화를 수행해야하는 경우 사용자 지정 호출기 컨트롤러를 사용 가정 해 보겠습니다.

    - (id)initWithCoder:(NSCoder *)decoder {

        self = [super initWithCoder:decoder];
        return [self initWithViewControllers:@[self.playerViewController, self.categoriesViewController]
                  andTitles:@[@"Player",@"Categories"]];
    }

참고 URL : https://stackoverflow.com/questions/8766368/ios5-storyboard-uiviewcontroller-which-init-method-is-called-by-the-storyboard

반응형