My model object has a UIImage *iconImg
that is often updated asynchronously. I want to allow instances of other classes to observe any changes to myModel.iconImg
elegantly. Right now, my asynchronous image fetch class takes a UIImage**
(yes, ugly, but it's working). The problem, however, is that messing with the UIImage via pointers bypasses any KVO I might have enjoyed using properties, so I have to use NSNotification which I'm not a big fan of. Here are the main requirements:
myModel.iconImg
instance will be made aware of changes (unlike with Notifications where I currently have to filter)iconImg
properties that all need to work this way, not just oneI can change my image fetcher class if necessary (here's current signature):
+ (BOOL)asyncImageFetch:(UIImage**)anImagePtr withURL:(NSURL*)aUrl;
Not sure how clear that is, so let me know if I can elaborate on anything.
Thanks,
Steve
For anyone looking with similar requirements, take a look at SDWebImage (looks like Olivier Poitrey is the original author). Github repository here: https://github.com/rs/SDWebImage.
I've been using it and it's very nice.