I don’t know how much I can say about the app that I am creating due to some NDA functionality, even if it may not be new I still would like to save myself, but I was wondering if there was a way to pass a xmlDocPtr through a selector? If so how is this possible? I know that I can take a char* and convert it to a NSString, but does a xmlDocPtr have the same capability to convert to an id type?
Share
What do you mean “pass an xmlDocPtr through a selector”? Given that you seem to be trying to convert it to an obj-c object, I’m assuming you’re trying to use
-performSelector:withObject:? Because if you’re just calling the method, there’s no restriction on types of arguments.If you need to dynamically call a selector that takes a non-obj-c object, you have two alternatives. The first, and recommended, approach is to create an
NSInvocation.The second is to cast
objc_msgSend()to the appropriate function type and call that, although this gets more complicated (and somewhat architecture-dependent) if there’s floating point values or struct values involved (as method arguments or return value). You should only take this approach if you’re comfortable playing with the obj-c runtime.