In WatchKit Apple gives us around 20mb of space to cache images.
This cache is persistent across launches and images get evicted when the space runs out.
The problem is - How can you know if the image is still in the cache or not?
Consider this scenario: You cache an image to the watch with a key for future display. When the time comes to display the image, how do you know that it is still cached?
If there's no way to know, then you must cache it again. This would completely defeat the purpose of the cache if you have to send it to the device every time you display it.
Edit: The API was updated to fix this in iOS 8.2 beta 2. See Dave's answer for details.
Edit2: This was fully fixed in iOS 8.2 beta 3. See John's answer for details.
setImageNamed:
if you want to send it over, you usesetImage:
. The Watch doesn't do the falling back for you unfortunately. If you just usesetImage:
all the time, why have the cache? If you usesetImageNamed:
you have no feedback on whether it was actually set or not. That is the issue - JacksetImageNamed
never sends any images to the device FYI. If your talking aboutaddImageToCache
though, I've tried that hoping it would work but no, the 2nd time you call it it goes ahead and overwrites the first cached image. - Jack