由于某种原因,我无法立即显示活动指示器。也许任何人都可以看到为什么?
UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
spinner.center = self.view.center;
_active = spinner;
[self.view addSubview:spinner];
[spinner startAnimating];
@try {
[self connectToServerUsingStream:ip portNo:port];
NSString *text = @"test";
const uint8_t *str =
(uint8_t *) [text cStringUsingEncoding:NSASCIIStringEncoding];
[self writeToServer:str];
}
@catch (NSException * e) {
NSLog(@"Exception: %@", e);
}
微调器只显示然后连接到服务器,在此之前它不显示。有任何想法吗?