Hi all,
I just tried to follow the tutorial(https://itunes.apple.com/us/course/developing-ios-10-apps-with-swift/id1198467120) given on swift official website and tried to implement the calculator assignment.
But there is a compile problem in my code.
For "private var brain = CalculatorBrain()" this line, the error message is "Cannot invoke initializer for type 'CalculatorBrain' with no arguments". However, the CalculatorBrain is a struct. It should be a given free initializer. Why does this problem happen? And how do I fix it?
I did Google this question. But it turned out that most of the problem happened for the class initializer instead of for the struct's. Could you please give me some possible solutions or related resources? So I can try to figure it out.
Thank you so much!