I am trying to port a library of native iOS in Xamarin iOS by creating the binding library. I followed this tutorial. But I am stuck at the point of building the solution.
I had replaced void*
with IntPtr
because objective-c equivalent of void*
is IntPtr
in C#.
Any help will be appreciated. Thanks in advance.
Edit:
int32_t*
and int64_t*
of objective-c in C# to be more precise.
The answer depends on the purpose of the pointers: to pass variables to a method/function so the callee can alter the value; or for general pointer arithmetic.
In the first case if the use is to return multiple values from then an
out
parameter is required. If the use is more general and the parameter is used to read & write the passed variable then use aref
parameter.In the second case you should first consider redesigning your algorithms not to use pointers, which is more in keeping with the C# model. If you really need to perform general pointer manipulation then you need to use
unsafe
code and then the exact same pointer types you require are available.