Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

peacetrain67

macrumors member
Original poster
Dec 20, 2007
68
0
How do you apply the 'tag' property successfully (specifically for UIAlertViews + UIAlertSheets). Here is an example of code that is ineffective right now (In NSLogs, they are all loading the same delegate). I have looked through other threads but after applying those tips, I still am having no success:

Code:
- (IBAction)action:(id)sender
{
	UIAlertView *analert = [[UIAlertView alloc] 
									initWithTitle:@"title" message:@"message"
									delegate:self
									cancelButtonTitle:@"cancel"
									otherButtonTitles:nil];
	[analert addButtonWithTitle:@"uno"];
	[analert addButtonWithTitle:@"dos"];
	[analert addButtonWithTitle:@"tres"];
	analert.tag = 2;
	[analert show];	
	[analert release];	
}
- (void)buttons:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
	if (alertView.tag == 2) {
	switch(buttonIndex) 
	//case actions

[Please help ASAP] thanks
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.