Re: NSOutlineView crashes
Re: NSOutlineView crashes
- Subject: Re: NSOutlineView crashes
- From: Karl Kraft <email@hidden>
- Date: Mon, 26 May 2003 01:15:18 -0500
I ran into the same problem the first time I tried NSOutlineView in
Cocoa/Java. And like you, I was stymied because my simple starter code
didn't work, while the more complex code at
ftp://ftp.apple.com/developer/Sample_Code/Cocoa/JOutlineView.sit
works just fine.
After much head banging, I found the trouble to be in
outlineViewChildOfItem(). Like you I was using a String to represent
the items in the NSOutlineView while I tested. Doing this seems to
confuse the Java/Objective-C bridge as it converts it to a NSString
and back. Use a MyItem class like the example app, even if just to
wrap your String. Seems like a bug to me.
--
To purchase it is not like spending money
but rather it is an investment in the future
in a blow against the empire
On Monday, May 26, 2003, at 00:37 US/Central, Sean Gilbertson wrote:
>
>
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 );
>
}
>
>
>
I have looked at the Java test application, and it runs correctly, but
>
still I have had only limited success with minimal test code.
_______________________________________________
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.