Hi,
I was wondering how can you call java APIs or python APIs (either one) in Objective-C?
I know you could do this in cocoa:
id MyJavaClass = NSClassFromString(@"java.util.Vector");
id vector = [[MyJavaClass alloc] init];
[vector add"one item!"];
NSLog(@"item 1=%@", [vector get:0]);
[vector release];
this prints "item 1=one item!" in console, but that's it.
Does anyone has other examples? Like how to pass in arguments to a java constructor, like so:
id MyStringClass = NSClassFromString(@"java.lang.String");
id mystr = [[MyStringClass alloc] init"Hello World"];
But this does not work, i do not know why.
Any help is appreciated.
I was wondering how can you call java APIs or python APIs (either one) in Objective-C?
I know you could do this in cocoa:
id MyJavaClass = NSClassFromString(@"java.util.Vector");
id vector = [[MyJavaClass alloc] init];
[vector add"one item!"];
NSLog(@"item 1=%@", [vector get:0]);
[vector release];
this prints "item 1=one item!" in console, but that's it.
Does anyone has other examples? Like how to pass in arguments to a java constructor, like so:
id MyStringClass = NSClassFromString(@"java.lang.String");
id mystr = [[MyStringClass alloc] init"Hello World"];
But this does not work, i do not know why.
Any help is appreciated.