Mapping of primitive data type from Java to objective-C using j2objc

473 views Asked by At

I am translating a big project from Java to objective-C. When there are primitive data types, they will be translated to JNI Types instead of objective-C data types, such as boolean -> jboolean.

However, it is written in the documentation that the mapping should be directly from boolean to BOOL.

What I expect is it could translate from boolean to BOOL directly. Is it possible?

1

There are 1 answers

1
tball On BEST ANSWER

A jboolean is typedef'd as a BOOL when referenced from an Objective-C source. The translator used to output BOOL directly, but switched to jboolean (as well as jchar, jint, etc.) so JNI sources can be built without modification.