I have an NSTextField and I need to get the field’s value into a variable. What’s the appropriate method?
I have an NSTextField and I need to get the field’s value into a
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For an
NSStringyou would use:For an
intyou would use:There are many other methods for getting the value from a control. Have a look at the
NSControlreference for more info, under the “Getting and Setting the Control’s Value” section.Here’s a list:
doubleValuefloatValueintValueintegerValueobjectValuestringValueattributedStringValue