无法通过NSUrl设置UIImageView图像?

时间:2013-02-07 20:28:32

标签: uiimageview nsstring uiimage nsurl

我正在尝试根据天气设置图像,我知道获取天气图像链接的所有代码都可以工作,因为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

你可以看到的是一张图片......

有什么想法吗?

0 个答案:

没有答案