for (int x=0; x<7; x++)
{ //Setting x and y values of tiles
for (int y=0; y<5; y++)
{
tile[x][y].x = x;
tile[x][y].y = y;
tile[x][y].parent->x = -1; //<- crashes here with EXC_BAD_ACCESS
tile[x][y].parent->y = -1;
}
}
For some reason the above code crashes, im just trying to show that the parent of each tile is uninitialized. I have no reason why it would crash. I tried to set x, and y -1 in the constructor of the class but it also crashes
It is your program. I do no know what you are trying to do. I think that this member shall point to some other tiles that is it shall contain a valid address of another tiles.