Thursday, January 2, 2014

Very strange, textfield get less value

I dragged on. Xib file a textfield file, and then also pointing, ID is thistextfield, then add in the code


[Thistextfield.text length] == 0 prompts me wrong


p.p1 {margin: 0.0px 0.0px 0.0px 12.0px; text-indent:-12.0px; font: 11.0px Menlo} p.p2 {margin: 0.0px 0.0px 0.0px 12.0px; text-indent: -12.0 px; font: 11.0px Menlo; min-height: 13.0px}
error: request for member 'text' in something not a structure or union


I ask again, the content is the content of my input string, and what to do in order to assign it to another variable of type string it, I know that int can


int abian = [[thistextfield text] intValue]


Strings are


NSString abian = [[thistextfield text] stringValue] this? Ask the next

Reply:
NSString abian = [[thistextfield text] stringValue] you are not a little asterisk wrote
Should be NSString * abian = [[thistextfield text] stringValue] it
Reply:
1) NSString * abian = [NSString stringWithString: [thistextfield text]];

2) [thistextfield.text length] == 0 no problem. OK thistextfield is UITextField type. Or you just comment out this, look elsewhere there is no problem.


Reply:
In the header file is

IBOutlet id thistextfield

If I changed

IBOutlet UITextField thistextfield then, in no way associated with the file's owner

No comments:

Post a Comment