CallBack iOS not working

I am trying to call the static method of one code name of one class from an implementation of the built-in interface in Objective-C (iOS). So I am using a callback. I imported the header file of the required class and

#include "CodenameOne_GLViewController.h"

The building works, but the callback does not work (the method takes a line and displays a dialog with this line, but nothing is displayed when the application starts). Here is the callback line:

package_ClassName_methodName___java_lang_String(CN1_THREAD_GET_STATE_PASS_ARG fromNSString(CN1_THREAD_GET_STATE_PASS_ARG myString));

Where is my string declared as NSString * mySTring = @"hi!".

I tried a simple callback method that takes no arguments. Unfortunately, this did not work either.

package_ClassName_methodName__(CN1_THREAD_GET_STATE_PASS_SINGLE_ARG);

Did I miss something?

+4
source share
1 answer

, , , , .

, , :

boolean fake;

, , !

javac .

:

// this is always false and is here to prevent the optimizer from stripping code used from native code
if(fake) {
   MyCallbackClass.callback();
}

- , , "" , .

+3

Source: https://habr.com/ru/post/1682197/


All Articles