Re: setNeedsDisplayInRect and performSelectorOnMainThread?
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