I've tried various methods, which all give me warnings. Such as userName = [NSString stringWithFormat:@"%@", [yournamefield stringValue]];
which just gives me a warning of
'UITextField' may not respond to '-stringValue'
How do i do this?
Get the text inside the text field using the text
property
NSString *name = yourNameField.text;
NSDateComponents
and tell me if has state or behavior. Your argument is wrong. Property is term not strictly related to @property
syntax. Even in Objective-C 1.0 you used properties, but you had to to write accessors yourself. Dot syntax is just easier way to invoke methods without arguments, but should not be abused for clearly behavioral methods. But this is just styling issue and it works exactly the same. It's not implementation detail. --- Ah, again an old question, that appeared on SO main page :(
Jul 17, 2013 at 6:19
How about:
userName = [NSString stringWithFormat:@"%@", yournamefield.text];
stringWithFormat:
if the string the only content of the format string?
Two ways. It is a property and any property value can be accessed like this -
yournamefield.text
[yournamefield text]
-stringValue
is a method ofNSTextField