robovm / robovm-samples

RoboVM sample projects
Apache License 2.0
93 stars 72 forks source link

Can you add some method in CustomFrameworks sample using object-c block? #78

Closed liaogang closed 8 years ago

liaogang commented 8 years ago

I add a method and got this error: 2015-11-13 2 13 58
2015-11-13 2 14 19

No @Marshaler found for parameter 5 of @Bridge method   
 void      $m$asdf$$$(org.robovm.samples.customframeworks.ObjCAdder,org.robovm.objc.Selector,int,int,org.robovm.objc.block.VoidBlock1)>  
BlueRiverInteractive commented 8 years ago

There are a few issues with the Method binding.

  1. The selector should be asdf::result:.
  2. You need to annotate a native block with @Block.
  3. NSNumber should be bound as NSNumber in Java (not int or Integer).

So your binding should look like:

@Method(selector = "asdf::result:")
public native void asdf(int a, int b, @Block VoidBlock1<NSNumber> resultBlock);
liaogang commented 8 years ago

Great,it works

liaogang commented 8 years ago

How to import a object-c static library (.a) into robovm?