Subclass NSArrayController in Java
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