views:

12

answers:

0

I am trying to get the IKPictureChooser widget to work with Rococoa but every time I run the code I get a null pointer exception at the call to createClass IKPictureTaker. Here is my code:

interface IKPictureTaker  extends NSObject {

public static final _Class CLASS =
        Rococoa.createClass("IKPictureTaker",_Class.class);

public interface _Class extends NSClass {
    IKPictureTaker pictureTaker();
}
int runModal();

}

public class IKPictureTaker {

public static void main(String[] args)
{
    System.load("/Users/Mike/Downloads/rococoa-core-0-3.5/bin/librococoa.dylib");
    IKPictureTaker picTaker = IKPictureTaker.CLASS.pictureTaker();
    picTaker.runModal();

}
}

and there error is:

    Exception in thread "main" java.lang.ExceptionInInitializerError
at IKPictureTaker.main(IKPictureTaker.java:41)
    Caused by: java.lang.NullPointerException
at org.rococoa.internal.NSObjectInvocationHandler.<init>(NSObjectInvocationHandler.java:100)
at org.rococoa.Rococoa.wrap(Rococoa.java:117)
at org.rococoa.Rococoa.createClass(Rococoa.java:50)
at IKPictureTakerr.<clinit>(IKPictureTaker.java:26)

Is it not yet possible to use this class with Rococoa or do I just need to add some library to some path?