+ Reply to Thread
Results 1 to 2 of 2

Thread: UIAlertView

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    7

    Smile UIAlertView

    hi
    i want to perform action on UIAlertView.
    how to perform some action on UIAlertview's buttons or options.
    any help will be appreciated
    thanks

  2. #2
    Junior Member
    Join Date
    Oct 2012
    Posts
    10
    you can do it using UIAlertViewDelegate.
    Code:
    UIAlertView *signupALert = [[UIAlertView alloc]initWithTitle:@"Congratulation" message:@"Your registration was successfull, please proceed to login" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
                [signupALert show];
                [signupALert release];
    
    -(void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
        if (buttonIndex == 0)
        {
            ViewController *obj = [[[ViewController alloc] init] autorelease];
            [self presentModalViewController:obj animated:NO];
        }
    }
    here delegate
    Code:
    -(void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
    will be called when user clicks on any option, so you have to perform action using index of Selected Option.

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts