Re: NSURL produces spinning beach ball - how to get rid?
Re: NSURL produces spinning beach ball - how to get rid?
- Subject: Re: NSURL produces spinning beach ball - how to get rid?
- From: Peter Ammon <email@hidden>
- Date: Mon, 10 Sep 2001 12:08:44 -0400
On Monday, September 10, 2001, at 01:26 AM, Dave Fayram wrote:
On Sunday, September 9, 2001, at 09:24 PM, Yuhui wrote:
Hi
I have a portion of code that uses NSURL to get a HTML file, e.g.
data = [NSMutableString stringWithContentsOfURL:[NSURL
URLWithString:@"http://www.apple.com/"]];
where data is, sensibly enough, a NSMutableString.
However, this approach produces the spinning beach ball mouse cursor
and the app seems to freeze up while retrieving the data. Is there a
way to work around this freeze?
Thanks
Yuhui
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Put the fetch in a different thread (see NSThread).
Then have that thread call the action methods when it's done.
Put the fetch in a different thread (see NSThread).
Then have that thread call the action methods when it's done.
Hope that helped.
Instead of using an NSThread, I suggest creating an NSURL and using
loadResourceDataNotifyingClient: usingCache:. It will be much simpler
to implement.
-Peter