안녕하세요. 다음 코드가 있는데 다운로드하는 동안 ActivityIndicator를 표시하고 싶습니다. 그러나 다운로드가 완료되었을 때만 표시가 나타 납니까?NSURL 다운로드 파일 인디케이터가 너무 늦게 표시됩니다.
_fanDownloadIndicator.hidden = NO;
NSLog(@"batzn");
NSString *documentPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)objectAtIndex:0];
NSString *file = [documentPath stringByAppendingPathComponent:@"fan_new.mp3"];
BOOL fileExists = [[NSFileManager defaultManager]fileExistsAtPath:file];
if(fileExists == NO) {
NSURL *downurl = [NSURL URLWithString:url];
NSData *data = [NSData dataWithContentsOfURL:downurl];
if ([data writeToFile:file atomically:YES]) {
NSLog(@"downloaded fan");
더 많은 코드가 있습니까? 지금 나는 당신이 표시기를 어디에 보여줄지 모르겠다. – connor
@connor 코드의 첫 번째 줄은 표시기를 보여준다. – rmaddy