UITextField text
@property(nonatomic, copy) NSString *text
Discussion of [UITextField text]
This string is nil by default.
In iOS 6 and later, assigning a new value to this property also replaces the value of the attributedText property with the same text, albeit without any inherent style attributes. Instead the text view styles the new string using the font, textColor, and other style-related properties of the class.
UITextField text example.
userName = [NSString stringWithFormat:@"%@", yournamefield.text];
Example of [UITextField text].
mytext = [ [ NSString alloc ] initWithUTF8String:"Init'd with utf8" ] ;
tf.text = mytext;
[mytext release];
tf.text = mytext;
[mytext release];
UITextField text example.
you have to use the textfield delegate
-(void)textFieldDidEndEditing:(UITextField *)textField;
in this delegate make check like this
if ( [textField.text length] > 0 )
{
// the text field is empty do your work
}
-(void)textFieldDidEndEditing:(UITextField *)textField;
in this delegate make check like this
if ( [textField.text length] > 0 )
{
// the text field is empty do your work
}