【发布时间】:2011-07-14 20:06:58
【问题描述】:
我有这种按钮单击(下载)的方法。问题是它由于异常而终止:
[会议开始于 2011-03-14 13:06:45 +0530。] 2011-03-14 13:06:45.710 XML[7079:20b] *** 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序, 原因:'*** -[NSCFString isFileURL]:无法识别的选择器发送到实例 0x62b8'-(IBAction) download
{
UIImage *image = [UIImage imageWithData: [NSData dataWithContentsOfURL:@"http://ws.cdyne.com/WeatherWS/Images/thunderstorms.gif"]];
[image release];
}
有什么问题?
【问题讨论】:
-
为什么要发布图片?你没有分配它。
-
那是错误的!!!我的网址没有进入 uiimage。 UIImage image = [UIImage imageWithData: [NSData dataWithContentsOfURL:[jsonItem objectForKey:@"PictureURL"]]];错误:*** 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“** -[NSCFString isFileURL]:无法识别的选择器已发送到实例 0xd552c0”
标签: iphone uiimage nsdata nsurl