IOS 어플리케이션 시작 프로세스
int main(int argc, char * argv[]) {
@autoreleasepool {
NSLog(@"%s",__func__);
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(nullable NSDictionary *)launchOptions
이 방법에서는 프레임, 프록시 대상의 주 창, 그리고 UIWindow의 루트 보기 컨트롤러를 설정하여 주 창을 표시하고, 프로그램은 루트 보기 컨트롤러의 구체적인 상황에 따라 대응하는 View를 주 창에 불러옵니다.
3.UIApplication 프록시 객체 중 라이프 사이클과 관련된 부분은 다음과 같습니다.
a. 응용 프로그램이 비활성 상태에 들어갔을 때 호출되며, 이 기간에 메시지나 이벤트를 받지 않습니다. 예를 들어 전보를 보냅니다.
- (void)applicationWillResignActive:(UIApplication *)application {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
b. 프로그램이 백그라운드로 전송될 때 호출되며 백그라운드가 계속 실행되도록 설정하려면 이 방법에서 설정할 수 있습니다
- (void)applicationDidEnterBackground:(UIApplication *)application {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
c. 프로그램이 백엔드에서 프론트 데스크톱으로 실행될 때 호출됩니다.
- (void)applicationWillEnterForeground:(UIApplication *)application {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
d. 프로그램이 활성 상태일 때 실행되며 메시지나 이벤트를 수신할 수 있습니다
- (void)applicationDidBecomeActive:(UIApplication *)application {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
e. 프로그램이 종료될 때 호출되며, 보통 데이터를 저장하고 청소합니다
- (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.