我正在尝试根据天气设置图像,我知道获取天气图像链接的所有代码都可以工作,因为NSLog向我显示了我正在尝试加载的NSUrl字符串,它确实是正确的图像...
NSURL * weatherimageURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://server.placesforios.com/server/icons/%@",weatherimagestring]];
NSString *testing = [NSString stringWithFormat:@"http://server.placesforios.com/server/icons/%@",weatherimagestring];
NSLog(testing);
NSData * imageData = [NSData dataWithContentsOfURL:weatherimageURL];
UIImage * weatherImage = [UIImage imageWithData:imageData];
[weather setImage:weatherImage];
NSLog输出:2013-02-07 15:24:38.131 App [7732:907] http://server.placesforios.com/server/icons/Light Snow
你可以看到的是一张图片......
有什么想法吗?