Hi:
I need 2 alerts in my class
Code taken from (the iPhone Developer's Cookbook) and works fine with if you have only one alert. When user presses Ok/Cancel button it (void)alertView:(UIAlertView *)alertView activates function.




- (void) presentSheet
{
        UIAlertView *alert = [[UIAlertView alloc]
                                                  initWithTitle: @"Enter 
Information"
                                                  message:@"Specify the Name and 
URL"
                                                  delegate:self
                                                  cancelButtonTitle:@"Cancel"
                                                  otherButtonTitles:@"OK", nil];
        
        [alert show];
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex: (NSInteger)buttonIndex
{
        printf("User Pressed Button %d\n", buttonIndex + 1);
printf("Text Field 1: %s\n", [[[alertView textFieldAtIndex:0] text] cStringUsingEncoding:1]); printf("Text Field 2: %s\n", [[[alertView textFieldAtIndex:1] text] cStringUsingEncoding:1]);
        [alertView release];
}

Now I have another alert in same file.

- (void) presentSheet2
{
        UIAlertView *alert = [[UIAlertView alloc]
                                                  initWithTitle: @"need 
Information"
                                                  message:@"Have you heard from 
Apple"
                                                  delegate:self
                                                  cancelButtonTitle:@"No"
                                                  otherButtonTitles:@"Yes", 
nil];
        
        [alert show];
}


How can we distinguish which alert we are talking about?
Thanks in advance.

Agha

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to