iOS 프로그램 전체 프로세스 시작

1247 단어
1. 먼저main 함수를 실행한다
int main(int argc, char * argv[]) {
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}

ios 개발 문서에서 이main 함수에 대해 다음과 같이 설명합니다.
This function is called in the  main  entry point to create the application object and the application delegate and set up the event cycle.
이 함수는 응용 프로그램 대상과 응용 프로그램을 만드는delegate 대상이며 이벤트 순환의 주요 입구점을 설정합니다.
 
세 번째 매개 변수는 UIApplication , nil, UIApplication 。입니다. UIApplicationDelegate , nil, main nib 。 UIApplication 。
2. UIApplication 객체 및 UIApplication delegate 객체를 만들고 이벤트 사이클을 시작합니다(appdelegate 응답 이벤트 처리 시작).
3. appdelegate의 window 속성으로 설정된 UIWindow 객체 만들기
4. info에 따라.plist storyboard 로드
5.storyboard의 화살표가 가리키는 컨트롤러를 UIWindow의 루트ViewController로 설정
6. 전시 인터페이스

좋은 웹페이지 즐겨찾기