不顯示圖像我加載從URL從XML圖像來圖像不顯示圖像的UIImageView在ipad
CGRect mywebframe=CGRectMake(0,60,700,300);
UIImageView*imageView=[[UIImageView alloc] initWithFrame:mywebframe];
NSString*imageurl=aBook.image;
imageurl=[imageurl stringByReplacingOccurenceOfString:@"\n" withString:@""];
imageurl=[imageurl stringByTrimmingCharacterInSet:[NSCharacterSet whitespaceCharacterSet]];
NSURL*url=[NSURL URLWithString:imageurl];
NSData*data=[[NSData alloc] initWithContentsOfURL:url];
UIImage*imagetemp=[[UIImage alloc] initWithData:data];
imageView.image=imagetemp;
[subView addSubView:imageView];
通過在瀏覽器中打開URL來檢查URL,同樣如果圖片尺寸較大,則需要更多時間來加載取決於您的網絡連接速度。 – KingofBliss 2011-12-20 12:01:04
'[FileManager defaultManager] fileExistsAtPath:url]'return? – Jessedc 2011-12-20 12:06:01