[layer tileGIDAt:position]
If I give it a position outside the map, I get an Assertion Failure, which is just normal.
I need a way to know when a tile exists. Before running the above code so I don’t get a an Assertion Failure and also to do other things in case the tile does not exist. But how can I? Is there not a method in the CCTMXLayer class to check that?
To test if a tile exists, test if the tile GID is 0. Before that you can test if the position is on the tilemap as such: