2013-07-18 36 views
0

我使用的base64圖像顯示它在imageview的使用下面的代碼如何使用AFNetworking在UIImageView中顯示base64圖像?

NSURL *url = [NSURL URLWithString:prodDetCompl.AttPath]; 
NSData *imageData = [NSData dataWithContentsOfURL:url]; 
UIImage *ret = [UIImage imageWithData:imageData]; 
cell.imageView.image = ret; 

,但我需要使用AFNetworking加載沒有成功

[imageview setImageWithURL:[NSURL URLWithString:@""] placeholderImage:[UIImage imageNamed:@"sampleimages.jpeg"]] 

圖像如何做到這一點

感謝

+0

「AFNetworking」許可有什麼阻止您進行更改? –

回答

0

我不知道我明白什麼不適合你,但是你不應該這樣做:

NSURL *url = [NSURL URLWithString:prodDetCompl.AttPath]; 
[imageview setImageWithURL:url placeholderImage:[UIImage imageNamed:@"sampleimages.jpeg"]] 

當然,您應該確保您的包資源中有一個「sample images.jpeg」圖像可用作佔位符圖像。

+0

佔位符圖片顯示url圖片(base64)不顯示 – sabeer

+0

您確定佔位符圖片與您的應用程序捆綁在一起嗎? – sergio