Here is an example constructor in Java:
public Board(int row, int column)
{
this.row = row;
this.column = column;
}
...
int row;
int column;
and here is my method in Objective C I am trying to do the same thing:
- (void) setSquares: (int) row:(int) column
{
self.row = row; // <-- Error
self.column = column;// <-- Error
}
...
int row;
int column;
As you can see I get 2 errors because the compiler thinks I am trying to access 2 properties, one called row and one called column. I know this is how you are suppose to access properties but how are you suppose to 'change the scope' so that I can set the local variables to the parameters of the method? How do I do this in Objective C?