Help - Programmatically creating bindings in Java
Help - Programmatically creating bindings in Java
- Subject: Help - Programmatically creating bindings in Java
- From: email@hidden
- Date: Thu, 08 Jan 2004 20:15:04 +0000
I am trying to programmatically set the binding for a NSTableColumn that has a custom cell. I have seen code in ObjC that works but I can't get it to work in Java. The compiler is generating an error:
can't resolve symbol : method bind (java.lang.String,com.apple.cocoa.application.NSArrayController,java.lang.String,
com.apple.cocoa.foundation.NSDictionary)
NSArrayController myArrayController;
NSTableColumn myTableColumn;
NSDictionary myDict;
...code...
myTableColumn.bind("backgroundColor", myArrayController, "arrangedObjects.color", myDict);
Here's the doc:
bind
public abstract void bind(String binding, Object observableController, String keyPath, NSDictionary options)
Creates a relationship between the receivers binding and the property of observableController specified by keyPath. The binding is the key path for a property of the receiver previously exposed. The options dictionary is optional. If present, it contains placeholder objects or an NSValueTransformer identifier as described in Constants.
--------------------------
If you read the above, it is expecting a subclass of Object as the observable controller whereas in ObjC, it is expecting an id. The problem is that NSController is a subclass of NSObject and not Object. So you may think that it's not able to resolve it because of that, right? No. I tried casting it as an Object and also tried an Object placeholder.
Ideas??????
_______________________________________________
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.