我有以下代码在 UIImageView 上加载我想要从互联网上获得的图像:
NSString* mapURL = @"http://mydomain.com/image-320x480.png";
NSData* imageData = [[NSData alloc]initWithContentsOfURL:url];
UIImage* image = [[UIImage alloc] initWithData:imageData];
[marcaBackground setImage:image];
[imageData release];
[image release];
我不想硬编码图像的 URL,而是加载另一个 URL 的字符串,然后将该图像加载到 UIImageView 上。
我的 URL 仅返回另一个文本格式的 URL。
例如:http://mydomain.com/url
退货 http://mydomain.com/image-320x480.png
我怎么能完成这个任务?