On Fri, May 1, 2009 at 12:21 AM, Ken Tozier <[email protected]> wrote: > I could see where scrollRangeToVisible might cause a problem, but wouldn't > "length" be OK since it is just reading a value, not changing it?
Right, but the main thread might be changing it. Or might change it after you've read it. > How do you do that? The console view is a singleton and is initialized in > the AppController awake from nib method before anything else executes. Is > that enough to insure it is running on the main thread? May seem like a > silly question but I'm far from comfortable working with threads. I haven't > used them enough to know where the pitfalls and gotchas lie. No, that means that the initialization occurs on the main thread. Execution of any method dealing with the singleton is executed on the thread where it is... executed. There's nothing automatic about it. So if you call appendTime:message: on thread 101, then it executes on thread 101, even if the object was created on thread 0. So what you can do (and there are other ways too) is create a method called appendTimeAndMessage:(NSArray*)someArguments and call that with performSelectorOnMainThread and ilk. _______________________________________________ Cocoa-dev mailing list ([email protected]) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
