megha
megha

Reputation: 84

UIAlertview not working fine in ios7

Clicking on ok or cancel button in UIAlertview is not working fine. When I am clicking ok or cancel button, UIAlertview is not dismissed but if i clicking twice on ok or cancel button then and only then UIAlertview get dismissed.

This is my code.

alert = [[UIAlertView alloc] initWithTitle:@"Plese Enter comma seperated sets"
                                                             message:@"\n"
                                                            delegate:self
                                                   cancelButtonTitle:@"Cancel"
                                                   otherButtonTitles:@"Save", nil] ;
            CGRect rect = {12, 60, 260, 25};
            dirField = [[UITextField alloc] initWithFrame:rect] ;
            dirField.backgroundColor = [UIColor whiteColor];

        alert.alertViewStyle = UIAlertViewStylePlainTextInput;
        dirField.text = setString;
        [dirField setText:@"test"];
        [dirField becomeFirstResponder];
        [alert addSubview:dirField];
        [alert show];

Upvotes: 0

Views: 399

Answers (1)

Bhavesh Lathigara
Bhavesh Lathigara

Reputation: 1415

Meghaji

I think there is problem in your method , I mean it is calling 2 times.

Thanks

Upvotes: 1

Related Questions