-1
- (IBAction)segueBut:(id)sender {
    if(_textField.text.length>0&& _textField1.text.length>0 && [_textField1.text isEqual:@"zeeshan"])
    {
        NSString *textoftextfield=_textField.text;
        [ [NSUserDefaults standardUserDefaults] setObject:textoftextfield forKey:@"Name"];
        NSString *textoftextfield1=_textField1.text;
        [ [NSUserDefaults standardUserDefaults] setObject:textoftextfield1 forKey:@"Password"];
        [self performSegueWithIdentifier:@"segueidentifier" sender:self];
    }
    else
    {
        UIAlertView *alert= [[UIAlertView alloc]initWithTitle:@"Error" message:@"Insert Username and password Textfield is empty"   delegate:nil cancelButtonTitle:@"cancel" otherButtonTitles:@"OK", nil];
        alert.delegate=self;
        [alert show];
    }
}
Makyen
  • 29,855
  • 12
  • 76
  • 115
Zeeshan
  • 51
  • 5

2 Answers2

1

Use property placeholder of text field and pass string.

_textField.placeholder = @"Enter Something";
Lalit Kumar
  • 1,838
  • 2
  • 24
  • 43
0

The syntactic sugar way:

_textField.placeholder = @"your text here";

Or the normal way:

[_textField setPlaceholder:@"your text here"];
Popeye
  • 11,356
  • 9
  • 56
  • 88
oyvindhauge
  • 3,496
  • 2
  • 29
  • 42