Re: Data not written immediately to nstextview
Re: Data not written immediately to nstextview
- Subject: Re: Data not written immediately to nstextview
- From: MANISH CHATURVEDI <email@hidden>
- Date: Thu, 18 Jan 2007 15:43:58 +0530 (IST)
Thanks Joar...[NSView display] worked.....:)
I need to do all this because I want to print some of the logs created by application...to the user in a NSTextView..........to make him aware of what my application is doing currently...and i not gonna write a lot of stuff to NStextview.
will that minimal logging also cause significant performance issue?
also when we call NSLog to write to console log, data is written there immediatly...does it also causes performance degradation...i have used a lot of NSLog in my app?
Thanks.
Aashish
----- Original Message ----
From: j o a r <email@hidden>
To: MANISH CHATURVEDI <email@hidden>
Cc: Cocoa Developers <email@hidden>
Sent: Thursday, 18 January, 2007 1:26:27 PM
Subject: Re: Data not written immediately to nstextview
On Jan 18, 2007, at 8:14 AM, MANISH CHATURVEDI wrote:
> But the data is not written (or shown) immediately in the
> NSTextView, it is shown only after completion of the method that
> contains this code segment. As the method performs a bulk of task,
> NSTextView shows data after a significant delay.
This works per design, and is a significant advantage to the way
Cocoa triggers drawing updates (compared to, for example .NET). Views
that needs to be re-drawn are flagged as such (see "-[NSView
setNeedsDisplay:]") and redrawn at the end of the current event loop.
It's very unlikely that you would want to change this behaviour. If
you do, it is quite probable that you have an implementation where
you're blocking the main thread for too long, which would be really
bad for the user experience, and the over all performance of your
application.
That said, in the unlikely event that you do need to force a display
update, you can use the "-[NSView display]" method.
> is there any problem in my code, or any property NSTextView not set
> properly.
No, se above.
> is there any threading concept.
Probably not, but that you even ask that question is cause for
concern...
I hope you're not updating your text view from a non-main thread?
j o a r
__________________________________________________________
Yahoo! India Answers: Share what you know. Learn something new
http://in.answers.yahoo.com/
_______________________________________________
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