我有一個UIImageView試圖加載圖像,如果它不存在,我打電話下載圖像。一旦圖像被下載,NSNotification被髮送並且UIImageView.image被設置爲下載的圖像。這是行得通的,但在圖像設置爲在UIImageView中顯示後需要幾秒鐘。在圖像下載完成後,再次發送通知,因此延遲不是圖像的下載。UIImageView.image需要幾秒鐘時間通過NSNotification設置時顯示
以下是通知:
- (void)recieveImageDownloadUpdate:(NSNotification *)notification {
if ([[item valueForKey:@"FlipBookPhotoID"] intValue] == imgView1.tag) {
// this loads the image if the tag on the UIImageView matches the notification update
imgView1.image = [Helpers getImageDownloadIfMissing:[[item valueForKey:@"PhotoName"] stringByReplacingOccurrencesOfString:@"_lg" withString:@""] withManufacturer:[item valueForKey:@"ManufacturerID"] withFlipBookID:[item valueForKey:@"FlipBookID"] withFlipBookPhotoID:[item valueForKey:@"FlipBookPhotoID"] shouldDownload:NO ];
}
}
所有這一切都與尋呼一個UIScrollView用於啓用,如何獲取這些圖像的通知後,立即顯示。
可以提供更多的細節... – Ali3n
有一噸的代碼,只是想知道如果我需要調用強制屏幕更新 – Slee