我的SuerClass UICollectionViewCell有一个属性:
var selected: Bool
Run Code Online (Sandbox Code Playgroud)
我的班级是
MyClass : UICollectionViewCell {
func setSelected(selected: Bool) {
super.selected = selected
// do something
}
}
Run Code Online (Sandbox Code Playgroud)
前者在XCode 6.2中运行良好,但在XCode 6.3Beta2中它引发了一个错误:
Method 'setSelected' with Objective-C selector 'setSelected:' conflicts with setter for 'selected' from superclass 'UICollectionViewCell' with the same Objective-C selector
Run Code Online (Sandbox Code Playgroud)
如何解决这个问题与XCode 6.3 beta2一起使用?
编辑:我也试过了
override func setSelected(selected: Bool) {
super.selected = selected
// do something
}
Run Code Online (Sandbox Code Playgroud)
这导致错误:
var selected: Bool
Run Code Online (Sandbox Code Playgroud)