Hello,
Here is my code.

// This function defines the vertices of the mesh/grid
-(void)populateMesh{
verticalDivisions = kVerticalDivisions;
horizontalDivisions = kHorisontalDivisions;
...