Hi,
I have 2 questions regarding about calling iOS functions.
-
How can I call an Obj-C function?
Right now in my Unity3d C# code, I have:[DllImport(“__Internal”)]
static extern public void _PressButton();
I’m calling _PressButton() on my Start() then I export the file as a simulator. And in the AppController.mm, I added the following line of code:
extern “C”{
void _PressButton(){
NSLog(@"Hello World");
}
}
However, it seems to fail…
-
I wanted to add another view ontop of the project. So, I went to OPENEAGL_UnityCallback(…) and added this line of code ontop of [_windows makeKeyAndVisisble];
MyView *myView = [[MyView alloc]init];
[sGLViewController.view addSubview:myView.view];
It somehow pops up an error to me about OBJC_CLASS$_MyView, of the linker command failed with exit code.
Is it because I’m running on a simulator and not an actual device? May anyone give me some tips on how to fix this.