Re: NSThread question
Re: NSThread question
- Subject: Re: NSThread question
- From: Charles Srstka <email@hidden>
- Date: Wed, 20 Feb 2002 19:33:14 -0600
The AppKit isn't thread-safe, so when you call NSTableView from the
thread, it can cause a crash. You can use DO to get threading to work
right, but I would just use NSTaskDidTerminateNotification to tell when
the task is done, and avoid using threads altogether, if it were me.
On Wednesday, February 20, 2002, at 10:40 AM, Fabio Genoese wrote:
Hi,
I'm working on a ObjC Cocoa app which makes use of the output of a
command line tool.
Since I didn't want to wait for the output I put all the command line
accessing stuff into a new thread using:
[NSThread detachNewThreadSelector: @selector(getDataAndInsert:)
toTarget:self withObject:sender];
Now, what I do in "getDataAndInsert:" is calling this command line
tool, read the output and create a new record for my NSTableView. After
adding the record to my data source, I call [myTableView reloadData] to
update the table view. However, this line causes a crash - always
(signal 6 (SIGABRT))! I tried without the line and there are no
problems. I'm a bit clueless why this happens...
Any ideas?
Thank you,
Fabio
_______________________________________________
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.
_______________________________________________
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.