23 升级swift 3.1 问题 1

2017-04-17  本文已影响0人  rebeccaBull

谢谢大家的无私分享

http://blog.csdn.net/qq_30513483/article/details/52983819  升级swift问题总结

https://www.baidu.com/link?url=Me1tDsKBdGNYt17XLeeGsNOQNyOvaWsWl1ilKV1qo3ve5M78-bGH-B5YzfbF1QnD&wd=&eqid=c416a8450006f9b20000000458f2282c    2.3升级到3.1碰到的问题

https://zhuanlan.zhihu.com/p/22584349  适配 Swift 3 的一点小经验和坑

Compiler error: Method with Objective-C selector conflicts with previous declaration with the same Objective-C selector 

编译器错误:使用Objective-C选择器的方法与以前的声明冲突

Objective-C does not support method overloading, you have to use a different method name. When you inherited UIViewController you inherited NSObject and made the class interopable to Obj-C. Swift on the other hand does support overloading, that's why it works when you remove the inheritance.

Objective-C不支持方法重载,您必须使用不同的方法名称。当您继承UIViewController时,您继承了NSObject并使该类与Obj-C相互作用。另一方面,Swift支持重载,这就是为什么它在删除继承时起作用。

上一篇下一篇

猜你喜欢

热点阅读