I am making a project in the *iPhone* and I am very beginner person.
I am making `Tic Tac Toe` application and I want to make a function that change the turn from `'X' to 'O'`

So I tried to type this 

```
void setTurn(){
    SinglePlayer*SO=[[SinglePlayer alloc]init];
    SO .turn =1;
    if (SO.turn%2==0){
        SO-&gt;turnLabel.text=@"O Turn";
    }
    else SO-&gt;turnLabel.text=@"X Turn";
    SO.turn++;
}

```

and SO means `SinglePlayerObject`.

Whatever I defined this in the header of the implementation 

And when I tried to type this method `putSign();` under the method

```
-(IBAction)PutSign2:(id)sender{
    if (turn%2 !=0){
        label2.text=@"X";
    }
    else if (turn%2 ==0){
        label2.text=@"O";
    }
}

```

it shows an error. 

So how can I run a method as same as **C++** because I have an experience with **C++**?

this is the header file 

```
#import <UIKit/UIKit.h>

@interface SinglePlayer : UIViewController{

    IBOutlet UILabel*label1;
    IBOutlet UILabel*label2;
    IBOutlet UILabel*label3;
    IBOutlet UILabel*label4;
    IBOutlet UILabel*label5;
    IBOutlet UILabel*label6;
    IBOutlet UILabel*label7;
    IBOutlet UILabel*label8;
    IBOutlet UILabel*label9;

    BOOL Player;

    int turn;

    IBOutlet UILabel*turnLabel;

}
@property (nonatomic)int turn;
@property (nonatomic) BOOL Player;
-(IBAction)PutSign1:(id)sender;
-(IBAction)PutSign2:(id)sender;
-(IBAction)PutSign3:(id)sender;
-(IBAction)PutSign4:(id)sender;
-(IBAction)PutSign5:(id)sender;
-(IBAction)PutSign6:(id)sender;
-(IBAction)PutSign7:(id)sender;
-(IBAction)PutSign8:(id)sender;
-(IBAction)PutSign9:(id)sender;
void setTurn();

@end

```

and this is the uncompleted implementation 

```
@implementation SinglePlayer
//Player=true = X
//Player=False= O
@synthesize Player;
@synthesize turn;

void setTurn(){
    SinglePlayer*SO=[[SinglePlayer alloc]init];

    SO .turn =1;
    if (SO.turn%2==0){
        SO->turnLabel.text=@"O Turn";

    }
    else SO->turnLabel.text=@"X Turn";
    SO.turn++;
}
//this code to put the sign in the button label:-
//[sender setTitle:@"X" forState:UIControlStateNormal];
-(IBAction)PutSign1:(id)sender{
    if (turn%2 !=0){
        label1.text=@"X";
    }
    else if (turn%2 ==0){
        label1.text=@"O";
    }
turnLabel.text=@"O Turn";
}
      putSign();
-(IBAction)PutSign2:(id)sender{
    if (turn%2 !=0){
        label2.text=@"X";
    }
    else if (turn%2 ==0){
        label2.text=@"O";

    }
}    
   putSign();

-(IBAction)PutSign3:(id)sender{
    if (turn%2 !=0){
        label3.text=@"X";
    }
    else if (turn%2 ==0){
        label3.text=@"O";

    }
}
 putSign();
-(IBAction)PutSign4:(id)sender{
    //[sender setTitle:@"X" forState:UIControlStateNormal];
}

putSign();

```