У меня есть приложение для загрузки изображений на server.image, загрузка на сервер успешно, и progressbar также работает. Но я хочу показать предупреждение после того, как progressbar будет выполнен ... вот мой код для progressbar.show alertview после progressbar done
- (void)connection:(NSURLConnection *)connection didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite
{
float progress = [[NSNumber numberWithInteger:totalBytesWritten] floatValue];
float total = [[NSNumber numberWithInteger: totalBytesExpectedToWrite] floatValue];
progress_bar.progress = progress/total;
NSLog(@"%f",progress/total);
}
, так что мой вопрос - как показать предупреждение после того, как progressbar равен 100%.
'if (progress == total) {showAlert}'? – Larme
Или это может быть 'float actualProgress = progress/total; if (actualProgress == 1.0) {showAlert} ' – iphonic