• 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
Subclass NSArrayController in Java
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Subclass NSArrayController in Java


  • Subject: Subclass NSArrayController in Java
  • From: DevReseune <email@hidden>
  • Date: Sat, 18 Sep 2004 23:34:40 +0200

Hi,

For many (good) reasons, I use Java to develop Cocoa applications. Binding is for me a powerfull solution, but it's not perfect, even in Objective-C. With Java, this new technology is more difficult to use.

My problem is to subclass a controller, as NSArrayController. This class has 2 constructors:
- NSArrayController()
- NSArrayController(content)
But, as for all widget in InterfaceBuilder, if you don't provide a constructor with NSCoder, you will have this error:
ObjCJava WARNING:
jobjc_jvm_newObject(): constructor with signature (Ljava/io/InputStream;)V on class java/io/ObjectInputStream failed (should morph the java exception)


So, you have to provide this constructor:
- NSArrayController(NSCoder coder, long token) > that calls super() in my code.
Now, you will have this error:
ObjCJava WARNING:
old -initWithCoder: failed because ObjC result != self


> http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Java/Protocols/NSCoding.html#//apple_ref/java/intf/com.apple.cocoa.foundation.NSCoding

So, what is the solution?

PS: what does "token" mean in the constructor?


Frederic
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: [ANN] Project distribution tool Verpack
  • Next by Date: Re: Converting an Absolute path to a relative path?
  • Previous by thread: Re: Notification to NSApp Strangeness SOLVED
  • Next by thread: Unicode replaceOccuranceOfString?
  • Index(es):
    • Date
    • Thread