views:

154

answers:

1

Hi,

I'm working on an app right now that was working fine until I started implementing some threading for background loading of images. Now theres no crashes but the keyboard does not display. That is to say its invisible (I can still type, I just cant see the actual keyboard). The only thing I've done was implement threading so I'm wondering if I'm somehow messing with the thread the keyboard runs on or something?

The threads I'm calling are like:

[NSThread detachNewThreadSelector:@selector(loadWebView:)
    toTarget:self withObject:[NSNumber numberWithInt:pageNum]];

and

[scrollView performSelectorOnMainThread:@selector(addSubview:) 
   withObject:curWebView waitUntilDone:NO];

Thanks in advance.

+1  A: 

UIWebViews (and all UI elements) cannot be used on background threads safely. If you wish to load images in the background, use NSURLConnection's asynchronous loading methods.

rpetrich
Ah. Well I managed to solve my problem by pushing all the UI stuff into a method being called by performSelectorOnMainThread and it seems to be working. Thanks :)
kiyoshi