Java: NSTableColumn subclass in IB?
Java: NSTableColumn subclass in IB?
- Subject: Java: NSTableColumn subclass in IB?
- From: Bill Bumgarner <email@hidden>
- Date: Wed, 2 Apr 2003 01:33:35 -0500
I'm experiencing a very disturbing crash when loading a NIB file that
has a subclass of NSTableColumn that is used within the NIB file. In
this case, I have an NSTableColumn subclass defined as (it is a simple
subclass that delegates dataCellForRow()):
public class DelegatingTableColumn extends NSTableColumn {
...
}
Now -- if I set a single table column to use this class in my NIB file,
the NIB fails to load. If it is the first non-Main NIB to load, it
will cause the app to wedge, the window to be stuck on screen and CPU
utilization to shoot to 100% until the app is kill -9'd from a terminal
window. If it is the second non-Main NIB to load, then the following
error message is printed...
2003-04-02 01:27:47.760 FooApp[2830] *** file inconsistency: read
'@fff@@cc', expecting 'C'
... and the app fails to load the NIB, but remains responsive.
In all cases, I'm using pre-10.2 NIB archival format as the 10.2 keyed
archiver format has bugs.
I experienced something similar in the past when creating a Java
subclass of NSButton and instantiating that within the NIB file. In
that case, I had to implement a specific protected-- and therefore
undocumented-- constructor to make it work:
public class FooDraggableButton extends NSButton {
protected FooDraggableButton(NSCoder aCoder, long aLong) {
//! if this undocumented constructor is not implemented, very
bad things happen at launch.
super(aCoder, aLong);
}
....
}
Without that constructor, loading the NIB containing an instance of
FooDraggableButton blows up during NIB unarchival.
NSTableColumn does have a protected constructor...
protected DelegatingTableColumn(boolean aFlag, int anInt) {
super(aFlag, anInt);
}
... but adding the above does not help -- does not change the behavior.
Does anyone have any clues? I know I can programmatically setup the
NSTableView with instances of DelegatingTableColumn, but that is such a
tedious pain in comparison to using IB to do the same!
thanks,
b.bum
(wishing this project was in ObjC or PyObjC about now)
_______________________________________________
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.