RunLoops and performSelectorOnMainThread problem
RunLoops and performSelectorOnMainThread problem
- Subject: RunLoops and performSelectorOnMainThread problem
- From: "Martin F. Carianni" <email@hidden>
- Date: Wed, 6 May 2009 09:13:19 +0200
Hello, i'm having some trouble with CFRunLoop, and
performSelectorOnMainThread. I've a CFFTP client (with a latter COCOA
implementation to interface with the GUI-class) which needs to pass a
directory listing array to the GUI. But when I try to send the array
object via an external selector (on a NSView class) it will ignore my
performSelectorOnMainThread when called from the end of the directory
listing callback. I don't know why, but it will call the internal "to
self" methods but completely ignores the "self.delegate" ones. I
cannot communicate with my GUI and this is very frustrating.
//From the FTP directory listing CallBack method (endpart, where
results are printed to screen):
case kCFStreamEventErrorOccurred:
error = CFReadStreamGetError(info->readStream);
fprintf(stderr, "CFReadStreamGetError returned (%d, %ld)
\n", error.domain, error.error);
goto exit;
case kCFStreamEventEndEncountered:
fprintf(stderr, "Listing complete\n");
goto exit;
default:
fprintf(stderr, "Received unexpected CFStream event
(%d)", type);
break;
}
return;
exit:
MyStreamInfoDestroy(info);
CFRunLoopStop(CFRunLoopGetCurrent());
[self.delegate
performSelectorOnMainThread:@selector(listWasRetrieved:)
withObject:salvataggioListaEst waitUntilDone:YES];
[self performSelectorOnMainThread:@selector(laprova) withObject:nil
waitUntilDone:YES];
[self.delegate listWasRetrieved:salvataggioListaEst];
return;
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden