Skip to content

Instantly share code, notes, and snippets.

@joecannatti
Created November 2, 2010 16:39
Show Gist options
  • Save joecannatti/659909 to your computer and use it in GitHub Desktop.
Save joecannatti/659909 to your computer and use it in GitHub Desktop.
tag property demo
-(void)someSituation{
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"" message:@"" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
alert.tag = 0;
[alert show];
[alert release];
}
-(void)someOtherSituation{
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"" message:@"" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
alert.tag = 1;
[alert show];
[alert release];
}
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex{
if([alertView tag] == 0){
//foo
}
else{
//bar
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment