• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: JavaBridge question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JavaBridge question


  • Subject: Re: JavaBridge question
  • From: Thomas Finley <email@hidden>
  • Date: Sun, 29 Jun 2003 09:48:31 -0400

On Sunday, June 29, 2003, at 05:34 AM, Rolf wrote:
1. This might be a dumb question, but is this class still a 100% "java.util.Vector" class on the Objective C side, or has it been "bridgded" to a native Objective C class ? A NSLog(@"Class=%@",[result class]) returns "java/util/Vector" so I guess not. Attempting to use it as NSMutableArray
(which I guess it the class that mostly resembles Vector) does not work.

You're right, it is a "java.util.Vector". _Some_ automatic conversion happens, as when passing NSString to a method that requires java.lang.String, and also some primitive types like ints and the rest, but otherwise you're on your own mostly.

2. What memory management rules apply on the Objective C side to java objects ? Can I trust Java's garbage collector 100% on Java objects that are passed on to Objective C code ?

No. Even though the object uses Java to perform methods and the rest, this is a mere reference to a Java object wrapped in an genuine Objective-C object, and that Objective-C wrapper object is memory managed just like any other object you're used to dealing with: retains and releases. :)

On the flip-side, using ObjC from Java gives you the advantages of the Java GC.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Follow-Ups:
    • Re: JavaBridge question
      • From: Rolf <email@hidden>
References: 
 >JavaBridge question (From: Rolf <email@hidden>)

  • Prev by Date: Re: NSImage drawing way too small
  • Next by Date: Re: C program translation
  • Previous by thread: JavaBridge question
  • Next by thread: Re: JavaBridge question
  • Index(es):
    • Date
    • Thread