Hi guys,
I'm following the beginner's tutorial on building a meal rating app. I've managed to work my way through all steps with the helpful comments on this website to debug some issues myself, but now i've run into a bug that i can't seem to fix.
It's about this piece of code:
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
let button = UIButton(frame: CGRect(x: 0, y: 0, width: 44, height: 44))
button.backgroundColor = UIColor.redColor()
button.addTarget(self, action: #selector(RatingControl.ratingButtonTapped(_:)), forControlEvents: .TouchDown)
addSubview(button)
}xCode gives me all sorts of error messages in this code. It says it expected a separator in front of the #selector expression. It shouldn't, according to the tutorial, and if i do that, it gives me 7 more bugs. Even though, when my despair grew high, i simply copy/pasted the code from the tutorial (to be found here). It still gave me the error message.
A list of the error messages that i get:
line 6
Expected ',' separator
Expected expression in list of expressions
I then tried closing xCode and opening the whole project again, and this time 3 more error messages showed up for line 5:
Expected expression in list of expressions
Expected ',' separator
Missing argument for parameter 'action' in call
You can find two screenshots of my error messages here:
In the end i tried downloading the example script file, but the same error message appeared in that file.
If anyone could give me an answer to what i'm doing wrong here, i would be immensely grateful.