Hi I need to comunicate c++ with objective c (which it's a framework)

Ganuba Studios
Wed, 04 Aug 2021 15:14:57 +0000
UI

My problem its that I want to call a objetivce c Method and nothing happens (the console don’t throw any errors either), the method its never called.

The framework it’s very simple, it only have a .mm file and a swift class:

This is the header of the .mm file

The .mm file:

From the unreal side I have this class that receive the button event from a blueprint and call another class named “UnrealBridge.mm” (it is a .mm file but I tried with .cpp too)

The UnrealBridge.mm header:

UnrealBridge.mm file:

I also tried to call the .mm methods from the framework with: “[UnrealPluginBridge MethodName]” (UnrealPluginBridge it is the interface name on objetive c). “[[UnrealPlugin shared] MethodName]” it is the instance of the swift class on the framework side (but I dont think that is possible to call from c++ directly to swift).

The framework is included I think because I added in the build.cs file and the header doesnt throw any errors (so the engine found the headers) and then I linked manually the framework in xcode to avoid “Library not found” at runtime

I tested the app by running the xcode project but also creating the .ipa file from unreal - build to iOS.
I believe that I’m doing something wrong in the structure from the unreal side, because I’m sure that the framework structure is working, I also tried to expose the methods for the interface on “extern ‘C’” or changing the +(void) to just void _initSdk(); for example.

if someone can help me it will be amazing, thanks in advance for reading all this! have a nice day

2 posts - 2 participants