一部のデータを(同期して)ダウンロードしているときに進行状況を確認したいのですが、ダウンロードが完了するまでUIViewサブクラス(カスタム進行状況ビュー)が表示されません。ここにいくつかのコードがあります:
self.progressView.hidden = NO;
// I would expect the progressView to show up now
// but it doesn't
int i = 0;
for (Something *something in someList) {
if (something...) {
i++;
// do something
// start downloading some data
NSString *urlPath = [NSString stringWithFormat:@"somePath"];
NSURL *aURL = [NSURL URLWithString:urlPath];
NSData* responseData = [NSData aURL];
// parse out the JSON data
NSError* error = nil;
NSArray* json = [NSJSONSerialization
JSONObjectWithData:responseData
options:kNilOptions
error:&error];
for (NSDictionary *currentObject in json) {
// do some stuff
}
}
}
// the progressView does show up here... why?
何かをダウンロードする前に非表示に変更したprogressViewは、すべてのダウンロードが完了した後に表示されます。どうしてこんなことに?そして、すべてのダウンロードの前にprogressViewを表示するにはどうすればよいですか?