[ 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
}
留言
張貼留言
您好:
歡迎到訪我的Blog,這裡有我的生活經驗、美好的回憶和程式開發經驗分享~
目前努力學習Swift中,希望你會喜歡Swift!
如果可以也請你留言給我一個鼓勵喔!
謝謝