- (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];
}
}
Asked
Active
Viewed 65 times
-1
-
possible duplicate of [Placeholder in UITextView](http://stackoverflow.com/questions/1328638/placeholder-in-uitextview) – l'L'l Jul 16 '15 at 09:05
-
@I'L'I Question is for UITextFiled not for UITextView – kb920 Jul 16 '15 at 09:06
-
1What exactly is your question? – n00bProgrammer Jul 16 '15 at 09:37
-
1explain your requirement, otherwise it will be downvoted & get deleted – Pawan Rai Jul 16 '15 at 10:24
2 Answers
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