Working on personal pet project - Beers (I need to write about it!), I have made some use of FastImageCache created by Path. Maybe it’s not best suited for current project, but does the work for now (I have to write about this too!).
This project has an admin module. As an iOS developer, ofcourse this needs to be also done on iOS. Specifically on iPad.
After laying out all the code for API communication and pulling/caching images from Amazon S3 I used FastImageCache to present pulled images.
Everything was set up by instructions
And callback in view controller:
But images were just not appearing. Cache completion block for image hit was just not called. Everything was executing perfectly until my network call was hitting cache callback. Then it just disappeared.
No matter what I tried, I coud not figure out where it goes.
When you can’t figure something out, then it needs to be deleted and started from scratch :)
After rewriting image pull part without additional caching besides FastImageCache, all was wired up again, but my callback was not called |-(
Thank god for open source. Time to dive into FastImageCache source. After some poking around I ended up at this piece of code:
Problem was in my setup:
Image format was defined only for phone. When executing admin app on iPad no images table was created and all cache hit attempts were ignored…
This was four hours well spent :)
Tags: ios, fastimagecache, gotcha