• 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
Re: Main Thread UI and Detached Thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Main Thread UI and Detached Thread


  • Subject: Re: Main Thread UI and Detached Thread
  • From: Mike <email@hidden>
  • Date: Fri, 04 Apr 2008 00:08:52 -0700

Ken Victor wrote:
At 1:08 PM -0700 3/31/08, email@hidden wrote:
Date: Mon, 31 Mar 2008 12:20:41 -0700
From: Mike <email@hidden>
Subject: Re: Main Thread UI and Detached Thread
To: Apple Cocoa List <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

I have two methods in the main thread that I call from the worker using
performSelector, etc. The method for updating the progress bar for
example looks like this:

- (void)setProgressBarValue:(double)value
{
    if( progressBar )
    {
        [ progressBar setDoubleValue:value ];

        [ progressBar setNeedsDisplay:YES ];

        [ progressBar display ];
    }
}


are you calling:
    performSelectorOnMainThread:withObject:waitUntilDone:
(or one of its variants) passing in a selector for setProgressBarValue: ?

could it possibly be that setProgressBarValue: takes a double argument, yet performSelector... expects an id for the withObject parameter? thus, you have potential garbage being passed to your setProgressBarValue method.

ken

If that is the case then why does the progress bar get updated with the correct value every time when I insert the sleep( 1 ) call? Obviously it wouldn't be displaying the correct value if garbage was being sent to the selector.


Mike
_______________________________________________

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: Main Thread UI and Detached Thread
      • From: "Shawn Erickson" <email@hidden>
    • Re: Main Thread UI and Detached Thread
      • From: Scott Ribe <email@hidden>
    • Re: Main Thread UI and Detached Thread
      • From: j o a r <email@hidden>
  • Prev by Date: Re: Main Thread UI and Detached Thread
  • Next by Date: Re: Main Thread UI and Detached Thread
  • Previous by thread: Re: Main Thread UI and Detached Thread
  • Next by thread: Re: Main Thread UI and Detached Thread
  • Index(es):
    • Date
    • Thread