-(void)otherGames
{
UIAlertView *alertMsg = [[UIAlertView alloc]
initWithTitle:@"This gGame was Developed By:"
message:@"Burhan uddin Raizada"
delegate:nil
cancelButtonTitle:@"Dismiss"
otherButtonTitles: @"@twitter" , nil];
[alertMsg show];
}
-(void)alertMsg:(UIAlertView *)alertMsg clickedButtonAtIndex:(NSInteger)buttonIn… {
if (buttonIndex == 1) {
NSString *containingURL = [[NSString alloc] initWithFormat:@"http://www.twitter.com/…
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: containingURL]];
}
}
the first alertmsg is working absolutely fine. but when i added a like to the new "@twitter" button, then it just doesn't work. otherwise everything is working fine. i am wondering why it doesn't, but it should..need help.
Assuming that
is
You must set your delegate to
self
and add the delegat protocol to your header :Edit : According to @holex, use
alertView:willDismissWithButtonIndex:
instead of -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex