在今天早上升级到8.3之后,我得到了主题中的错误。
下面的代码过去工作得很好,但是它不能再编译了。你们谁能帮帮我?
protocol CustomAccessoryProtocol {
func controlButtonPressed(tag:Int)
}
class CustomAccessory : UIInputViewController {
var accessoryView : UIView!
var delegate : CustomAccessoryProtocol!
@IBOutlet weak var returnButton: UIButton!
@IBOutlet weak var backButton: UIButton!
@IBOutlet weak var forwardButton: UIButton!
init(delegate: CustomAccessoryProtocol){
super.init()
self.delegate = delegate
}
required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
fatalError("init(coder:) has not been implemented")
}
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
let customNib = UINib(nibName: "CustomAccessory", bundle: nil)
accessoryView = customNib.instantiateWithOwner(self, options: nil)[0] as! UIView
}
@IBAction func buttonPress(sender: AnyObject) {
delegate.controlButtonPressed(sender.tag!)
}
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(accessoryView)
}
}发布于 2015-04-14 16:28:43
我在使用NSWindowController的以下代码中也遇到了同样的问题:
init() {
super.init()
}我将其更改为:
convenience init() {
self.init()
}我在想,苹果对便利性的要求比以前更严格了。
https://stackoverflow.com/questions/29531133
复制相似问题