Re: WebView blocks User Interface
Re: WebView blocks User Interface
- Subject: Re: WebView blocks User Interface
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Thu, 05 Dec 2013 19:34:27 +0700
On 5 Dec 2013, at 19:25, Roland King <email@hidden> wrote:
>
> On 5 Dec, 2013, at 7:47 pm, Gerriet M. Denkmann <email@hidden> wrote:
>
>> 10.9.0. Given a search field, the user enters some chars, and a WebView is filled with all words containing these chars.
>>
>> Works fine, but one problem:
>> When the user wants all words containing "no" but types a bit slowly, then this happens:
>>
>> - actionMethodFromSearchField: sender
>> receives "n"
>> makes htmlContent for "n" (takes no time, but is about 2 million chars long)
>> sends: [ webView loadHTMLString: htmlContent baseURL: nil ];
>> returns after some fraction of a second.
>> The user now has finally found the key labelled "O" and presses it, but it does not show in the SearchField. Instead the spinning beach ball appears.
>>
>> After 50 seconds the WebView shows its content, the spinning beach ball disappears, the "o" finally appears in the SearchField and actionMethodFromSearchField is called again, this time with "no" and all is fine from here on.
>>
>> How can I keep my user interface responsive?
>>
>> Gerriet.
>>
>
> Don't send 2Mb of search results to your webview. Do you really need the case where you search for one character only? Don't send data until you have more than one and don't send obviously too much data to be useful to the user.
Well, the users might want all words with 'n'. In which case they would happily wait 50 seconds.
I do not know how to differentiate this from a slow typing of "no".
Gerriet.
_______________________________________________
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