 |
 |
SIGBUS with cocoa-java: help!
|
 |
|
 |
|
Forum Regular
Join Date: Nov 2001
Location: Australia
Status:
Offline
|
|
I've just about given up. I have a small cocoa-java app that I've been playing with recently, but after it runs for a few seconds it crashes with the following message:
sample.app has exited due to signal 10 (SIGBUS).
The problem exists with the NSTableView I'm using as a one column list. I use a custom class for the data source which has an array to store the values for the table.
I've read the archive of apple and omni developer email lists and understand that I need to keep a reference to the object(s) that get sent to the NSTableView via the data source (otherwise the objects get garbage collected and cause the SIGBUS). I can't however figure out which objects to do this too and how to do it exactly.
Any help much appreciated!
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status:
Offline
|
|
I have a cocoa java app that uses several tables in different windows. Are you sure that you are calling all of the required delegate methods:
// required delegate methods, note arguments not listed.
numberOfRowsInTableView
tableViewObjectValueForLocation
tableViewSetObjectValueForLocation
intFromTableColumn
Also, have you hooked up your sourceData and delegate connections in Interface Builder?
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Nov 2001
Location: Australia
Status:
Offline
|
|
Thanks for responding.
Originally posted by macrophyllum:
<STRONG>I have a cocoa java app that uses several tables in different windows. Are you sure that you are calling all of the required delegate methods:
// required delegate methods, note arguments not listed.
numberOfRowsInTableView
tableViewObjectValueForLocation
tableViewSetObjectValueForLocation
intFromTableColumn</STRONG>
I have all of those except the last one which I am not familiar with. I can't find it in the documentation.
<STRONG>
Also, have you hooked up your sourceData and delegate connections in Interface Builder?</STRONG>
I don't think so. Once again, I'm unfamiliar with this. Could you please provide an explanation for this?
Thanks again.
[ 05-18-2002: Message edited by: V0ID ]
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Nov 2001
Location: Australia
Status:
Offline
|
|
Update:
I've done some experimenting and come up with the following results.
I installed the April beta developer tools (was using December with update) and created two cocoa-java projects. Both have a NSTableView with 1 column, a NSTextField and NSButton. Both have two java classes, Controller and DataSource (for the NSTableView). When you click the button, whatever is in the NSTextField gets put into the NSTableView as a new row.
The difference between the two is what the classes are subclassed from. The first one, both classes are subclassed from java.lang.Object, whereas with the second project, both are subclassed from NSObject.
And guess what, no SIGBUS on either. I can't figure out why. The only thing I did different between these two projects and the one where I get the SIGBUS error, is that I created all the classes (and instantiated) them in Interface Builder. With the original project (the SIGBUS one) I used IB to create the controller object, but I created the other two manually in PB (including the dataSource).
Does anyone have any ideas as to what's going on??
This leads me to my next question: In a cocoa-java project, when should I subclass from java.lang.Object, and when from NSObject? (I created a new thread)
Confused :/
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Nov 2001
Location: Australia
Status:
Offline
|
|
I've found the problem. I'm too stupid to use a computer :o And I'd like to take this opportunity to formally resign from all programming activities.
PS. Does anyone else find Gdb infinitely more useful than Java debugger?
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status:
Offline
|
|
No. The Java debugger always seems to work well for me. Most of my problems end up being "bridge" issues, but the java debugger usually gives me pretty good stack traces so I know what bug report to file.
F-bacher
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Nov 2001
Location: Australia
Status:
Offline
|
|
How do you get java debugger to print a stack trace after the app has crashed?
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|