从1.1升级到1.2后出现奇怪的快速错误

Ale*_*lex 3 xcode objective-c ios swift

我在更新之前的项目与swift 1.1和Xcode 6.1.1一起工作正常.我刚刚升级到swift 1.2并在我的AppDelegate中得到一个奇怪的错误

 func application(application:UIApplication, didReceiveRemoteNotification userInfo:NSDictionary)
Run Code Online (Sandbox Code Playgroud)

还有一个派生自的类 UITextFieldDelegate

func textFieldDidBeginEditing(textField: UITextField!) -> Bool // called textfield for locationField clicked
Run Code Online (Sandbox Code Playgroud)

说点什么

Objective-C方法'应用程序:didReceiveRemoteNotification:'由方法'应用程序提供(:didReceiveRemoteNotification :)'与协议'UIApplicationDelegate'中的可选需求方法'application(:didReceiveRemoteNotification :)' 冲突

textFieldDidBeginEditing的错误是相同的:

Objective-C方法'textFieldDidBeginEditing:'由方法'textFieldDidBeginEditing'提供'与协议'UITextFieldDelegate'中的可选需求方法'textFieldDidBeginEditing'冲突

有什么问题?

Dej*_*dar 8

只需重写方法的名称(应自行修复),然后在方法中复制/粘贴代码.这应该工作.