我有一些代码从URL加载图像,它似乎工作正常。除非URL包含大括号。这似乎是一个字符串格式问题?我无法理解。
离 @“http://site/image.png //有效
@“http://site/ {image} .png //不起作用
NSString* mapURL = @"http://site.com/directory/{map}.png";
NSLog(mapURL);
NSData* imageData = [[NSData alloc]initWithContentsOfURL:[NSURL URLWithString:mapURL]];
UIImage* image = [[UIImage alloc] initWithData:imageData];
[imageView setImage:image];
[imageData release];
[image release];
感谢