views:

116

answers:

1

How to pass a C++ object with the performSelector method? This method only allows you to pass 'objc_object*' objects, I can't cast them. I could build a wrapper, but I don't know the overall superclass for all C++ objects, so I don't know how I could build a generic wrapper (I don't want specific knowledge about the object in the wrapper)..

Any hints?

+5  A: 

Try just using +[NSValue valueWithPointer:].

Ben Gottlieb
You may wish to create and delete the NSValue with the object it refers to for increased performance.
martinr
Superb, this works in conjunction with [myNSValue pointerValue] :)
StijnSpijker