NSOutlineView crashes
NSOutlineView crashes
- Subject: NSOutlineView crashes
- From: Sean Gilbertson <email@hidden>
- Date: Mon, 26 May 2003 01:37:19 -0400
Hello all,
I am attempting to create a Java-Cocoa test app which provides an
NSOutlineView.DataSource, to display things in an NSOutlineView.
However, I am getting crashes upon initial execution (SIGBUS most
recently), which provides me with no stack trace. Sometimes, the app
will actually start up, but if I click on an item, I get SIGSEGV.
There may be something simple I am overlooking, but it eludes me. Here
is my code:
public class OutlineViewDataSource extends NSObject
{
private ArrayList arr;
public OutlineViewDataSource( )
{
this.arr = new ArrayList( );
this.arr.add( "hi" );
this.arr.add( "hello" );
}
public Object outlineViewChildOfItem(NSOutlineView outlineView, int
index, Object item)
{
return this.arr.get( index );
}
public boolean outlineViewIsItemExpandable(NSOutlineView
outlineView, Object item)
{
if ( item == null ) {
return true;
} else {
return false;
}
}
public int outlineViewNumberOfChildrenOfItem(NSOutlineView
outlineView, Object item)
{
if ( item == null ) {
return this.arr.size( );
} else {
return 0;
}
}
public Object outlineViewObjectValueForItem(NSOutlineView
outlineView, NSTableColumn tableColumn, Object item)
{
return new String( "hello" );
}
// delegate method
public boolean outlineViewShouldEditTableColumn(NSOutlineView ov,
NSTableColumn tc, Object item) {
return false;
}
}
I have looked at the Java test application, and it runs correctly, but
still I have had only limited success with minimal test code.
If anyone could shed some light on this, I would be grateful.
Thanks,
Sean
_______________________________________________
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.