Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 17th, 2012  |  syntax: None  |  size: 0.93 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. UIAlertView delegate methods don't response on iOS 5.1
  2. //myClass.h
  3.     @interface MainMenu : UIViewController<UIAlertViewDelegate>
  4. -(IBAction)secondAct:(id)sender;
  5.        
  6. -(IBAction)secondAct:(id)sender
  7.       alert = [[UIAlertView alloc] initWithTitle:@"Dear User"
  8.                                                         message:@"Your Request Will be Sent To Security"
  9.                                                        delegate:nil
  10.                                               cancelButtonTitle:@"Cancel"
  11.                                               otherButtonTitles:@"OK", nil];
  12.   [alert show];
  13.   [alert autorelease];
  14. }
  15.        
  16. -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
  17.  NSLog(@"UIAlertView delegate works");//this line too isnt displayed
  18.  NSString *title=[ alertView buttonTitleAtIndex:buttonIndex ];
  19.  if ([title isEqualToString:@"OK"]) {
  20. NSLog(@"OK Pressed");
  21. }//i want to create something like this