Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Services in Java app



I am getting close to having my Java application act a a Service provider. However, whenever I try to access the data passed to me, my process dies with a Bus Error.

Here is my method that is called when the service is chosen:

public void indexText(NSPasteboard pBoard, NSStringReference strRef)
{
System.out.println(strRef.length());
System.out.println("indexText");
}


If I comment or the first line of the method, it successfully prints "indexText", so I know the system is finding my method correctly. However, if I try to do anything with strRef, like finding its length or calling string(), I get a Bus Error.

I haven't found any examples in Java of how to declare this method, so I'm just guessing I've got it right. Here is how one is declared in Obj-C

- (void)indexText:(NSPasteboard *)pboard

            userData:(NSString *)userData

            error:(NSString **)error

{
   .....
}

NSString doesn't exist in the Java bridge so I assume you are supposed to us NSStringReference instead. It is not clear what I'm supposed to do about error NSString**. Just declaring the method void seems to work in so far as the method is found and called.

Any help/suggestions would be appreciated.


-- Bill Tschumy Otherwise -- Austin, TX http://www.otherwise.com


_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.