Using iterateFunc to call objective c method

Posted by Matt Welch on Stack Overflow See other posts from Stack Overflow or by Matt Welch
Published on 2010-06-12T20:28:56Z Indexed on 2010/06/12 20:32 UTC
Read the original article Hit count: 306

Filed under:
|
|

Using spacemanager, I need to perform an action on select bodies after each step, so I figured that defining my own C function for iterateFunc would be the way to go.

Everything works great, except I'm not sure how to then call an obj c method in the same class. In other words, an obj c class contains both the c function replacing iterateFunc, and the method that needs to be called. I don't see how to tell the c function what 'self' is, such that I can call the method. As far as i can tell, there's no way to pass in any extra info to the new iterateFunc.

Any ideas, or a better way to go about things?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about cocos2d