2 Replies - 1761 Views - Last Post: 19 April 2012 - 06:33 AM

#1 hongsyang  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 19-April 12

UIAlertView question

Posted 19 April 2012 - 05:45 AM

im trying to make a UIAlertViewDelegate,
i already add the delegate in .h file just like: @interface PROGGameViewController: UIViewController <UIGestureRecognizerDelegate, PROGGameViewDelegate, PROGLevelDelegate, UIAlertViewDelegate>,
cause there are not only one delegate in my program

and i do the delegate menthod as normal, but when i click the alertview button, nothing run,

can someone tell me anything for help??

my program is all allright, i know something run in my alertviewdelegate part, but i dont know where

regards

Is This A Good Question/Topic? 0
  • +

Replies To: UIAlertView question

#2 jimblumberg  Icon User is online

  • member icon


Reputation: 4278
  • View blog
  • Posts: 13,433
  • Joined: 25-December 09

Re: UIAlertView question

Posted 19 April 2012 - 05:49 AM

You will need to show your code. Without it no one will be able to help.

Jim
Was This Post Helpful? 0
  • +
  • -

#3 hongsyang  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 19-April 12

Re: UIAlertView question

Posted 19 April 2012 - 06:33 AM

View Postjimblumberg, on 19 April 2012 - 05:49 AM, said:

You will need to show your code. Without it no one will be able to help.

Jim


- (void)alertView:(UIAlertView *)alertView clickButtonAtIndex:(NSInteger)buttonIndex
{
        
        if (buttonIndex == 0)
                
        {
                [delegate gameOverWithScore: gameScore];
        }
        else if (buttonIndex == 1)
                
        {
                NSLog(@"world");
        }
}
- (IBAction)showMessage
{
        
        UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"play again" 
                                                          message:@"do you want to restart the game?" 
                                                         delegate:self 
                                                cancelButtonTitle:@"ok" 
                                                otherButtonTitles:@"cancel", nil];
        [message show]; 
}



REGARDS

This post has been edited by jimblumberg: 19 April 2012 - 06:40 AM
Reason for edit:: Put code in code tags

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1