I have the following code:
eachShape(void *ptr, void* unused) {
cpShape *shape = (cpShape *) ptr;
id obj = shape->data;
NSLog(@"shape->data: %@", obj); // this is where EXC_BAD_ACCESS can occur
...
Some of you may recognize it from the Chipmunk physics framework used in iPhone development. Basically I crash here because of something I am doing in other code regarding the cpSpace, but I want to figure out what object type is getting sent here and crashing my NSLog statement (and causing other havoc).
What is the best way to dump the type and/or contents from a void pointer to an NSLog call?