• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How can we distinguish which alert we are talking about?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How can we distinguish which alert we are talking about?


  • Subject: How can we distinguish which alert we are talking about?
  • From: Agha Khan <email@hidden>
  • Date: Wed, 05 Aug 2009 11:08:14 -0700

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 (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: How can we distinguish which alert we are talking about?
      • From: Kyle Sluder <email@hidden>
    • Re: How can we distinguish which alert we are talking about?
      • From: Randall Meadows <email@hidden>
    • Re: How can we distinguish which alert we are talking about?
      • From: Chase Meadors <email@hidden>
  • Prev by Date: Re: Generating random numbers
  • Next by Date: Re: How can we distinguish which alert we are talking about?
  • Previous by thread: [OT] Re: Generating random numbers
  • Next by thread: Re: How can we distinguish which alert we are talking about?
  • Index(es):
    • Date
    • Thread