tags:

views:

38

answers:

2

Hello

I have a method SetBallVisibility declared in the interface for my view controller.

However, I get an undeclared identifier error when I try to use this in the implementation. What I am I doing wrong?

Interface

@interface TimeFrameController : UIViewController {

    IBOutlet UILabel *lblTime;
    IBOutlet UIButton *btnTimeoutOrRunning;
    IBOutlet UILabel *lblMessage;
    IBOutlet UIButton *btnNextVisit;

    IBOutlet UIImage *picRed;
    IBOutlet UIImage *picYellow;

    IBOutlet UIButton *btnRed;
    IBOutlet UIButton *btnYellow;

    IBOutlet UIButton *btnChangePlayer;

    IBOutlet UIButton *btnFrameOver;

    NSString *Player1Name;
    NSString *ActivePlayer;
    NSString *Player2Name;

    NSString *Player1Col;
    NSString *Player2Col;

    NSString *ActivePlayerCol;

    NSTimer *StopClock;

    int *StopClockOffset;
    int *StopClockPos;

    int *Player1Visits;
    int *Player2Visits;
}   

@property (nonatomic, retain) IBOutlet UILabel *lblTime;
@property (nonatomic, retain) IBOutlet UILabel *lblMessage;
@property (nonatomic, retain) IBOutlet UIButton *btnTimeoutOrRunning;
@property (nonatomic, retain) IBOutlet UIImage *picRed;
@property (nonatomic, retain) IBOutlet UIImage *picYellow;
@property (nonatomic, retain) IBOutlet UIButton *btnYellow;
@property (nonatomic, retain) IBOutlet UIButton *btnRed;
@property (nonatomic, retain) IBOutlet UIButton *btnChangePlayer;
@property (nonatomic, copy) NSString *Player1Name;
@property (nonatomic, copy) NSString *Player2Name;
@property (nonatomic, copy) NSString *Player1Col;
@property (nonatomic, copy) NSString *Player2Col;
@property (nonatomic, copy) NSString *ActivePlayer;
@property (nonatomic, retain) IBOutlet UIButton *btnNextVisit;
@property (nonatomic, retain) IBOutlet UIButton *btnFrameOver;

//@property (nonatomic, retain) NSTimer *StopClock;

bool *ColoursPicked;

//NSString *ActivePlayer;
NSString *ActivePlayerCol;

- (void)SetBallVisibility;
- (IBAction)NextVisitPressed:(id)sender;
- (IBAction)TimeOutOrRunningPressed:(id)sender;
-(void)StartStopClock:(int)nOffSet;
- (IBAction)ChangePlayer:(id)sender;
- (IBAction)YellowPressed:(id)sender;
- (IBAction)RedPressed:(id)sender;
@end

Implementation

#import "TimeFrameController.h"

@implementation TimeFrameController
@synthesize lblTime;
//@synthesize StopClock;
@synthesize btnTimeoutOrRunning;
@synthesize picRed;
@synthesize picYellow;
@synthesize lblMessage;
@synthesize Player1Name;
@synthesize ActivePlayer;
@synthesize Player2Name;
@synthesize btnRed;
@synthesize btnYellow;
@synthesize Player1Col;
@synthesize Player2Col;
@synthesize btnNextVisit;
@synthesize btnChangePlayer;
@synthesize btnFrameOver;


- (void)updateCounter:(NSTimer *)theTimer {

}

-(void) StartStopClock:(int)nOffSet{    
.....
}

- (IBAction)NextVisitPressed:(id)sender{
....    
    [SetBallVisibility];
.....   
}


- (void)SetBallVisibility{
    if ((Player1Visits > 1) && (Player2Visits > 1))
    {
    }
}

Cheers

Paul

A: 

You have to use

[self SetBallVisibility];

A message (=a method call) in Objective-C is always sent to an object, this goes too to methods from the same class.

Adam Woś
A: 

Thanks for this!

Rupert