Closed katopz closed 8 years ago
Read up a little bit on https://github.com/dropbox/djinni . It is a way to write code one place, and use it on both iOS and Android.
Thanks @skabbes , I just make it. :turtle:
Here's step for other noob (please correct me if i'm wrong)
/mx3/djinni/mx3.djinni
and addget_foo(): string;
/mx3/src/api.cpp
and addstring
Api::get_foo() {
return "bar";
}
/mx3/src/api.hpp
and addvirtual string get_foo() override;
/mx3/objc/play.m
and add getFoo
(why this convert to camel case btw? because it's getter/setter?)NSString * foo = [api getFoo];
NSLog(@"Hi, %@", foo);
$ make play
2015-03-22 10:08:30.103 play_objc[1049:9806] Hello, katopz
2015-03-22 10:08:30.103 play_objc[1049:9806] Hi, bar
I like to learning from the source more than reading doc (my bad habit) And I think this should be landing in wiki page for lazy dude like me ;)
Cheers!
Dang, I let this sit for so long. Sorry. But in case others discover this, yes this is correct. The conversion between lower_under
and camelCase
is simply because that is the standard convention for objc.
Thanks
Current example is great but when I try to add more function to api e.g.
I just can't find which file (should be
some.cpp
right?) to edit or add method. (noob!) I even try search allgetUsername
from example to see how it implement and where is came from. but so far I found only generated code with warningDO NOT MODIFY!
Any hint would be nice, I'm losing half day already :turtle: