• 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
performSelectorOnMainThread: problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

performSelectorOnMainThread: problems


  • Subject: performSelectorOnMainThread: problems
  • From: Anthony Duer <email@hidden>
  • Date: Wed, 30 Oct 2002 08:42:50 -0800

I have a secondary thread which needs to pass data to the main thread for drawing on the screen. I found a function in NSObject which seems to do exactly what I need: performSelectorOnMainThread:withObject:wait: However, my object doesn't seem to respond to it for some reason. It inherits directly from NSObject, so shouldn't it inherit this method as well?

The code looks something like:

- (void) socketRun: (NSString *)key
{
//Set up autorelease pool, connect to server
while(connected)
{
[mySocket readData: myData];
myString = [myData stringWithEncoding: UTF8];
[self performSelectorOnMainThread: @selector(parseData:) withObject: myString wait: NO];
}
//release pool, end thread
}

-(void) parseData: (NSString *)values
{
//parse data
//update palettes with images
}

~Anthony Duer, going to get this thing working eventually...
_______________________________________________
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.

  • Follow-Ups:
    • Re: performSelectorOnMainThread: problems
      • From: Scot Gellock <email@hidden>
  • Prev by Date: Input focus
  • Next by Date: Sync deleted and renamed files
  • Previous by thread: Input focus
  • Next by thread: Re: performSelectorOnMainThread: problems
  • Index(es):
    • Date
    • Thread