[ SWIFT ] - 異常處理 - Objective-C method 'application:didFinishLaunchingWithOptions:'


在swift升級至1.2版之後,對於原先開發的APP或多或少都會需要調整一下!
這次遇到的問題比較特殊,希望在與與大家分享解決方法!希望可以節省debug的時間

檔案名稱:AppDelegate.swift

[ 原始程式碼 ]:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {
        return true
    }

[ 錯誤訊息 ]:
Objective-C method 'application:didFinishLaunchingWithOptions:' provided by method 'application(:didFinishLaunchingWithOptions:)' conflicts with optional requirement method 'application(:didFinishLaunchingWithOptions:)' in protocol 'UIApplicationDelegate'

[ 錯誤訊息畫面 ]: 


[ 修改後程式碼 ]:
 func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        return true
    }

    

留言

熱門文章