Im новый тоже iOS. В моем приложении я реализовал UIAlertView
и хочу, чтобы не отображал alertView снова, когда пользователь нажимает кнопку ok и снова показывает предупреждение, если пользователь нажимает кнопку отмены. Пожалуйста, помогите мне. Тпх вот мой кодUIAlertView снова не отображается
if (chek) {
UIAlertView *alertView=[[UIAlertView alloc]initWithTitle:@"" message:@" hi " delegate:self cancelButtonTitle:@"cancel " otherButtonTitles:@"ok", nil];
[alertView show];
}
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
NSString *buttontitle=[alertView buttonTitleAtIndex:buttonIndex];
if ([buttontitle isEqualToString:@"ok"]) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sibche2://showapp/7030"]];
chek=!chek ; }
else if ([buttontitle isEqualToString:@"cancel "]){
NSLog(@"hello my friend");
chek=chek;
}
я думаю, что этот код correct.Please объяснить, что это проблема. –