Re: [FIXED] calling scrollPoint: on table view from separate thread locks up app
Re: [FIXED] calling scrollPoint: on table view from separate thread locks up app
- Subject: Re: [FIXED] calling scrollPoint: on table view from separate thread locks up app
- From: "Chase" <email@hidden>
- Date: Thu, 09 Aug 2007 21:11:46 +0000
On August 9, 2007, Nick Zitzmann wrote:
On Aug 9, 2007, at 2:14 PM, Chase wrote:
can someone shed some light on why this might be happening.
The AppKit isn't 100% thread-safe. You'll have to perform the scroll
in the main thread.
Nick Zitzmann
<http://www.chronosnet.com/>
thanks.
in case someone 10 years from now is searching through the list
archives for an answer to this question, here's what i did...
in init:
[[NSDistributedNotificationCenter defaultCenter] addObserver:self
selector:@selector(testnotificationreceiver:) name:@"ANIMALCRACKERS"
object:nil
suspensionBehavior:NSNotificationSuspensionBehaviorDeliverImmediately];
in thread:
[[NSDistributedNotificationCenter defaultCenter]
postNotificationName:@"ANIMALCRACKERS" object:nil userInfo:nil
deliverImmediately:YES];
and added the following method:
// this is called in the main thread:
- (void)testnotificationreceiver:(NSNotification *)notification
{
[mytableview scrollPoint:NSMakePoint(0.0,0.0)];
}
i used NSDistributedNotificationCenter, because it posts to the main
thread -- and does so by default too.
- chase
_______________________________________________
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