ios - 更改为 Swift 3 后,类型为 'UIBarButtonItem!' 的属性无法覆盖类型为 'UIResponder?' 的属性

标签 ios swift3 xcode-storyboard

我在这里声明了两个按钮:

@IBOutlet var previous: UIBarButtonItem! 
// No error even though its nearly identical

@IBOutlet var next: UIBarButtonItem! 
// contains error Property 'next' with type 'UIBarButtonItem!' 
// cannot override a property with type 'UIResponder?'

这工作正常,直到我升级到 swift 3。我尝试删除所有引用和按钮,使用编辑器重新链接没有运气

最佳答案

您需要从 next 更改您的 socket 的名称(以及它在 Storyboard 中的连接)。至nextItem ,作为 UIResponder 的 Swift 3 API现在有一个 next property .

关于ios - 更改为 Swift 3 后,类型为 'UIBarButtonItem!' 的属性无法覆盖类型为 'UIResponder?' 的属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42195605/

相关文章:

Swift 3,自定义 "="等于运算符 ? (不相等, "==")

ios - iOS swift 3.0 中 XMPP 的解决方案

interface-builder - 从 Storyboard打开 SKScene

ios - applicationWillResignActive 在 iOS 10 ( swift 3 ) 上无故调用

ios - 移动CALayer的动画?

ios - 使用 NSMutableDictionary 生成 plist

ios - 从嵌入在容器 View 中的 View Controller 继续

ios - 在 UITableView 中显示 Firebase 数据

ios - 我怎样才能像 map 应用程序那样做一个注释

iOS 自动布局 : two views of equal width and equally spaced