Say a user enters some text hey
into a NSTextField. I would like to extract this text to a NSString
, but for some reason, I can't.
I've been trying to find the answer to this question and I've seen many answers on this website saying that you can use NSString *string = [textField stringValue]
from "Getting the text from a NSTextField and setting it to an already defined String", but I get the errors "Expected ',' separator"
between NSString
and *string
and "Consecutive statements on a line must be separated by ';'"
between textField
and stringValue
.
How would you store the contents in the NSTextField to a string?