-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
  • 31,849
  • 12
  • 86
  • 121
Zeeshan
  • 51
  • 5

2 Answers2

1

Use property placeholder of text field and pass string.

_textField.placeholder = @"Enter Something";
Kumar
  • 1,882
  • 2
  • 27
  • 44
0

The syntactic sugar way:

_textField.placeholder = @"your text here";

Or the normal way:

[_textField setPlaceholder:@"your text here"];
Popeye
  • 11,839
  • 9
  • 58
  • 91
oyvindhauge
  • 3,496
  • 2
  • 29
  • 45