I can't seem to get an online GIF image to load into an NSImageView. Please see my code below and offer some comments to remedy this.
#import <Foundation/Foundation.h>
@interface ImageFromUrl : NSObject
@property (strong) NSString *urlString;
@property (strong) NSURL *url;
@property (strong) NSImage *radarGif;
@property (weak) IBOutlet NSImageView *radarGifView;
- (void)displayUrlImage:(id)sender;
@end
and
#import "ImageFromUrl.h"
@implementation ImageFromUrl
@synthesize urlString, url, radarGif, radarGifView;
- (void)displayUrlImage:(id)sender {
urlString = @"http://icons.wunderground.com/data/640x480/2xradarb5.gif";
url = [NSURL URLWithString:urlString];
radarGif = [[NSImage alloc] initWithContentsOfURL:url];
[radarGifView setImage:radarGif];
}
@end
I am receiving no errors when I run the application and the image of the GIF is not showing in the window.