Ваш вид входа в систему будет иметь текстовые поля Имя пользователя ( txtUsername ) и Пароль ( txtPwd ). И кнопка ( btnLogin ).
-(IBAction)Login:id(sender)
{
if([txtUsername.text length] !=0 && [txtPwd.text length] !=0)
{
// Navigate to view controller you want to
}
else
{
UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:nil message:@"please enter both the fields" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
[alertView release];
}
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if (buttonIndex == 0) {
//OK clicked
//Do something
}
else {
}
}