Search code examples
objective-ccocoalazy-loadingosx-snow-leopard

how to make the images downloading from web fastly?


i'm having array of image urls (say count=10), i have to display the images in NSCollectionView. but the images were took lot of time to display. what is lazy loading? i'm searching for mac osx not IOS.


Solution

  • If your images are not downloaded you can still show your view. You just display some placeholder, or an activityIndicator instead of each image, and when each of your images finishes downloading, you replace your placeholder with the correct image. Just make sure to download your images on an background thread and perform the replacing on the main thread. I recommend using NSOperationQueue for downloading on an background thread.