-[NSTextView setString:] causing app to lock up
-[NSTextView setString:] causing app to lock up
- Subject: -[NSTextView setString:] causing app to lock up
- From: Kevin Ballard <email@hidden>
- Date: Wed, 3 Nov 2004 10:23:28 -0500
I'm seeing a really weird behaviour in my simple app. The app is a
quick test for a new NSURLProtocol subclass I wrote and it consists of
a 1-line text field, a button, a spinning wheel progress indicator, and
a larger NSTextView. The 1-line field is for URL entry and it's bound
to an ivar of my controller. The button runs -query: on my controller.
-query: starts my progress indicator, creates an NSURLRequest for the
URL and runs an NSURLConnection with that request and itself as the
delegate. In the data callback it appends the data to a pre-initialized
mutable data ivar. In the finished loading callback it creates a string
out of that data and displays it in the field.
My problem is when it's displaying this string the main thread locks
up. From sampling the app it appears to be stuck on NSViewHierarchy
lockForWriting or something like that in response to the text view
trying to resize itself to fit the new contents.
If I write a much shorter string out it doesn't lock. Alternately, if I
disable the progress indicator (i.e. don't start the animation) and
write out the long string it doesn't lock up. If I disable the progress
indicator and move the -setString: to my data call (to try to show the
data as it comes in) then it locks up on the second or third data
callback.
Does anybody have any idea what's going on? I *am* doing this in the
main thread. And because it's locking up my main thread in response to
a simple -setString: I'm inclined to thing this is a bug in AppKit.
Does anybody have any more information before I use an incident on
this?
--
Kevin Ballard
email@hidden
http://www.tildesoft.com
http://kevin.sb.org
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden