I want to change the text of my Lable to another one, I do this with the help of GeneratedNameLable.text = "BUTTON" , but the compiler tells me that the code is incorrect:

enter image description here

    2 answers 2

    You have GeneratedNameLable as NSTextField, you can change the text as:

     self.GeneratedNameLable.stringValue = "\(result.sum)" 

    Or use UILabel , and then your code will not show an error.

      You declared it not UITextField (iOS class), but NSTextField (OSX class).