• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RunLoops and performSelectorOnMainThread problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: RunLoops and performSelectorOnMainThread problem
      • From: Michael Ash <email@hidden>
  • Prev by Date: UIToolbar setItems:animated: broken?
  • Next by Date: Re: Trouble with property (copy) and retain counts
  • Previous by thread: Re: UIToolbar setItems:animated: broken?
  • Next by thread: Re: RunLoops and performSelectorOnMainThread problem
  • Index(es):
    • Date
    • Thread