Hi,
I’ve written a few simple plugins for iOS, and they’ve worked, but there are two related questions which remain unresolved to me, which cause me discomfort when I think about them. Namely,
#1 When unity calls iOS native code, does it do so within the main execution thread? Specifically, when I access my Obective-C code from my extern "C"
functions, can I simply call the necessary functions, or should I performSelectorOnMainThread
?
#2 When I send structs, strings, and arrays to and from Unity, whose responsibility is it to delete/release them later? If I do need to worry about it, can you provide some examples for the most common data types?
I’ve read the mono interop guide, but it’s fairly complex, and I’m not sure I got everything it was trying to relay. Neither am I aware of how fully it describes the way Unity’s implementation works.
Thanks!