我收到以下代碼。在撥打webservice時顯示警告
UIActivityIndicator *activity = [[UIActivityIndicator alloc] initWithActivityIndicatorStyle:
UIActivityIndicatorStyleWhite];
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Processing" delegate:self otherButtonTitles:nil];
[alert addSubview:activity];
[activity startAnimating];
[alert show];
WebServiceController *web = [[WebServiceController alloc]init];
NSDictionary *dict = [web getDetails];
問題是警報沒有顯示。 WebServiceController是一個XML解析器,它從指定的URL獲取詳細信息並返回它們。警報應在服務被調用時顯示,因爲獲取詳細信息需要時間。但它只在服務呼叫結束後才顯示警報。這是爲什麼?
你可以給一些使用performSelectorOnBackgroundThread方法的例子的鏈接? –