Re: NSThread question
Re: NSThread question
- Subject: Re: NSThread question
- From: Alex Golovinsky <email@hidden>
- Date: Tue, 10 Jul 2001 15:22:23 -0400
Hi, I had a similar situation. My function called a thread that drew to
OpenGL. In my case I got the signal 10 (SIGBUS) because I allocated my
graphics context in the main function and did not retain it, so that by
the time my thread was called to draw, the context was already freed
since the original function returned. Perhaps you have a similar problem.
hope that helped,
Alex
>>>>>>>>
I still have an error (signal 10 (SIGBUS)). I'll explain exactly what I
do:
I have a -(void)doImage; method in a custom NSView object. This is the
method I'm calling in the new Thread, and it goes like this:
-(void)doImage
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc ] init];
[ self display ];
}
the method in which I call it goes like this:
-(void) setData:(NSData *) data
{
myData = [[NSData alloc] initWith
Data:data];
cachedImage = nil;
[NSThread detachNewThreadSelector:@selector(doImage) toTarget:self
withObject:nil];
}