我正在尝试在另一个内部显示警报视图,但遇到了问题。它短暂地出现......但在一秒钟后自行消失。
这是我的第一个警报视图委托中的代码:
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if(buttonIndex == 1)
{
Room *room = [[Room alloc] init];
room = [roomList objectAtIndex:alertView.tag];
currentRoom = room;
if([[alertView textFieldAtIndex:0].text isEqualToString:room.password]){
[self performSegueWithIdentifier:@"joinRoom" sender:self];
}
else{
alertMessage *message = [[alertMessage alloc] initWithTitle:@"Error"
message:@"Invalid password"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[message setStyle];
[message show];
}
}
}