setNeedsDisplayInRect and performSelectorOnMainThread?
setNeedsDisplayInRect and performSelectorOnMainThread?
- Subject: setNeedsDisplayInRect and performSelectorOnMainThread?
- From: dorian <email@hidden>
- Date: Sat, 20 Jan 2007 15:27:49 -0800 (PST)
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