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

Re: setNeedsDisplayInRect and performSelectorOnMainThread?


  • Subject: Re: setNeedsDisplayInRect and performSelectorOnMainThread?
  • From: "Julien Jalon" <email@hidden>
  • Date: Sun, 21 Jan 2007 01:03:51 +0100

setNeedsDisplayInRect: requests a NSRect as an argument, not a an
NSValue encapsulating an NSRect.

Of course, you can't pass the NSRect directly to performSelectorOnMainThread.

So you will have to implement something like
setNeedsDisplayInRectAsValue: and use that.

--
Julien

On 1/21/07, dorian <email@hidden> wrote:
I'm doing a multithreaded application which draws based on incoming
network packets (each socket draws to its own view).

The threading docs recommend using performSelectorOnMainThread: for any
setNeedsDisplay: type of calls that are needed from outside the main
thread, so I am doing that.

This works fine for setNeedsDisplay (v is the view):
[v performSelectorOnMainThread:@selector(setNeedsDisplay:)
        withObject:[NSNumber numberWithBool:YES] waitUntilDone:NO];


However, when I use it for setNeedsDisplayInRect, the display isn't updated (v is the view, r is a valid rect):

[v performSelectorOnMainThread:@selector(setNeedsDisplayInRect:)
        withObject:[NSValue valueWithRect:r] waitUntilDone:NO];


Any idea why this isn't working as expected? Replacing the instances of setNeedsDisplayInRect with setNeedsDisplay makes it function, but it seems to slow it down, so I'd like to get the inRect code working.



____________________________________________________________________________________
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: setNeedsDisplayInRect and performSelectorOnMainThread?
      • From: Darkshadow <email@hidden>
    • Re: setNeedsDisplayInRect and performSelectorOnMainThread?
      • From: dorian <email@hidden>
References: 
 >setNeedsDisplayInRect and performSelectorOnMainThread? (From: dorian <email@hidden>)

  • Prev by Date: Re: setNeedsDisplayInRect and performSelectorOnMainThread?
  • Next by Date: Re: [NSApp mainMenu] = null!!!
  • Previous by thread: Re: setNeedsDisplayInRect and performSelectorOnMainThread?
  • Next by thread: Re: setNeedsDisplayInRect and performSelectorOnMainThread?
  • Index(es):
    • Date
    • Thread