I am using the thread to call my function "initialGetMethod"
[NSThread detachNewThreadSelector:@selector(initialGetMethod) toTarget:self withObject:nil];
and my get method is
-(void) initialGetMethod
{
self.loginPassword = [[ UIAlertView alloc] initWithTitle:@"Please Login to MFP" message:@"Enter Valid UserID and Password" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Cancel", nil];
[self.loginPassword setAlertViewStyle:UIAlertViewStyleLoginAndPasswordInput];
[self.loginPassword setTag:2];
[self.loginPassword show];
}
but its giving the exception "Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. "
its giving the exception at "[self.loginPassword setAlertViewStyle:UIAlertViewStyleLoginAndPasswordInput];"
and if i call the function as "[self initialGetMethod];" its not giving the exception but it will take some time..
i tried loading in background but its not working.. (mean i dont want it to be in background)..
please suggest some solution ..