JNI wrapper for NSSavePanel

Michael Hall mik3hall at gmail.com
Sun Oct 7 11:00:30 PDT 2012


On Oct 7, 2012, at 9:40 AM, Steve Hannah wrote:

> JNIEXPORT jstring JNICALL Java_ca_weblite_mactools_Sandbox_saveDialog
> 
> (JNIEnv *env, jobject jthis, jstring title, jstring extension){
> 
>    //JNF_COCOA_ENTER(<#env#>);
> 
>    return JNFNSToJavaString(env, @"/Users/shannah/Downloads/out2.pdf");
> 
>    //JNF_COCOA_EXIT(env);
> }
> 
> If I uncomment the JNF_COCOA_ENTER/EXIT lines, it works properly.

I'm not sure what you mean by if you uncomment it works properly? That's what you want isn't it? The macros establish and tear down the environment for things like JNFNSToJavaString to work is my understanding.
I just noticed too that your instruction is a return so it won't hit the JNF_COCOA_EXIT.
Not sure either what that might do, but probably best to save the return, fall through the EXIT macro, and then do the return with the saved value.

Michael Hall

trz nio.2 for OS X http://www195.pair.com/mik3hall/index.html#trz

HalfPipe Java 6/7 shell app http://www195.pair.com/mik3hall/index.html#halfpipe

AppConverter convert Apple jvm to openjdk apps http://www195.pair.com/mik3hall/index.html#appconverter




More information about the macosx-port-dev mailing list