Tells the delegate that the launch process is almost done and the app is almost ready to run.

(告訴delegate啟動進程即將完成,應用程式即將開始運行)

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

Parameters

application

The singleton app object.

(單例應用程式物件)

launchOptions

A dictionary indicating the reason the app was launched (if any). The contents of this dictionary may be empty in situations where the user launched the app directly. For information about the possible keys in this dictionary and how to handle them, see “Launch Options Keys.”

(一個用來表示應用程式啟動原因的資料字典,不是必需的。如果使用者直接啟動這個應用程式,launchOptions會是空值。請參考“Launch Options Keys.”,來進一步瞭解這個資料字典裡會有什麼樣的關鍵字,以及如何處理它們)

Return Value

NO if the app cannot handle the URL resource, otherwise return YES. The return value is ignored if the app is launched as a result of a remote notification.

(如果應用程式不處理URL 資源,返回NO;否則,返回YES.如果應用程式有一個遠端通知啟動,返回值會被忽略)

Discussion

You should use this method (and the corresponding application:willFinishLaunchingWithOptions: method) to complete your app’s initialization and make any final tweaks. This method is called after state restoration has occurred but before your app’s window and other UI have been presented. At some point after this method returns, the system calls another of your app delegate’s methods to move the app to the active (foreground) state or the background state.

(建議使用這個方法(或者application:willFinishLaunchingWithOptions:)來完成應用程式的初始化工作,以及處理一些其他額外的工作。這個方法在應用程式狀態改變後調用,此時,應用程式視窗和其他UI元素還沒有被呈現出來。有時應用程式從這個方法返回後,系統會調用delegage的其他方法來將應用程式值為active foreground狀態),或者background狀態)

This method represents your last chance to process any keys in the launchOptions dictionary. If you did not evaluate the keys in your application:willFinishLaunchingWithOptions: method, you should look at them in this method and provide an appropriate response.

(如果你不在這個方法裡處理launchOptions,你將沒有機會再一次處理他們。如果你不在application:willFinishLaunchingWithOptions: 裡處理launchOptinons,你還可以在這個方法裡處理,並給出相應的回饋。)

Objects that are not the app delegate can access the same launchOptions dictionary values by observing the notification named UIApplicationDidFinishLaunchingNotification and accessing the notification’s userInfodictionary. That notification is sent shortly after this method returns.

(應用程式delegate以外的其他物件可以通過處理UIApplicationDidFinishLaunchingNotification通知來訪問launchOptions資料字典的userInfo資訊,這個方法返回後,很快會發送UIApplicationDidFinishLaunchingNotification通知

Important: For app initialization, it is highly recommended that you use this method and theapplication:willFinishLaunchingWithOptions: method and do not use the applicationDidFinishLaunching: method, which is intended only for apps that run on older versions of iOS.

(重點:強烈建議使用這個方法或者:willFinishLaunchingWithOptions: method來實現應用程式初始化的工作。不要使用applicationDidFinishLaunching:,這個方法只使用在舊版本的iOS應用程式中)

 

The return result from this method is combined with the return result from theapplication:willFinishLaunchingWithOptions: method to determine if a URL should be handled. If either method returns NO, the URL is not handled. If you do not implement one of the methods, only the return value of the implemented method is considered.

(應用程式結合這個方法的返回值和willFinishLaunchingWithOptions: 返回值來共同決定是否處理URL,兩者中任意一個返回NO,就不處理URL.If you do not implement one of the methods, only the return value of the implemented method is considered.)

, ,

狼翔月影 發表在 痞客邦 PIXNET 留言(0) 人氣()