Frage

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.

War es hilfreich?

Lösung

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.

Andere Tipps

Download files asynchronously .So that it wont affect the main thread.

Lazy loading is a design pattern commonly used in computer programming to defer initialization of an object until the point at which it is needed.

that is when the image is visible only it needs to be loaded.So do it that way.Collectionview and tableview populates in such a way itself

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top