RBAppDelegateをサブクラス化し、application:didFinishLaunchingWithOptions:
をオーバーライドすると、決して実行されません。そのヒント?アプリケーション:didFinishLaunchingWithOptions:RBAppDelegateをサブクラス化するときに実行されない
class AppDelegate: RBAppDelegate {
override func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
super.application(application, didFinishLaunchingWithOptions: launchOptions)
// won't be executed...
configureStuff()
return true
}
}
私は 'class AppDelegateObserver:NSObject、RBAppDelegateObserver'のインスタンスが作成された' override AppSet :: RBAppDelegate'を 'override init()'(それ以外は何もありません)に持っていて、 'observers.addObserver(AppDelegateObserver())'。 'AppDelegateObserver'では、' applicationDidFinishLaunching'を実装し、それを起動後設定用の場所として使用しますか?これは意図された方法であり、複数のオブザーバを登録するために使用されます。 'RBAppDelegateObserver'は通常のイベントのように見えます。' UIApplicationDelegate'は? – RyuX51
はい、正しいです。この方法を使用すると、UIApplicationDelegateイベントに対して複数のオブザーバを持つことができます。 –