• 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: [FIXED] calling scrollPoint: on table view from separate thread locks up app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: [FIXED] calling scrollPoint: on table view from separate thread locks up app
      • From: Alastair Houghton <email@hidden>
  • Prev by Date: Re: Integrating Unix scripting in Cocoa app
  • Next by Date: NSTableView and keyPath
  • Previous by thread: Re: Memory Management and NSView
  • Next by thread: Re: [FIXED] calling scrollPoint: on table view from separate thread locks up app
  • Index(es):
    • Date
    • Thread