In somebody's project I found a error. I know it is wrong. But it works well.
in .mm file do like this
- (void) DestroySelfBody{
[self unschedule:@selector(DestroySelfBody)];
if (m_body) {
m_body->GetWorld()->DestroyBody(m_body);
m_body = nil;
}
}
m_body is define by (b2Body is a c++ class):
b2Body * m_body;
Use nullptr
for C++ types: m_body = nullptr;
.