0

je le chemin suivant dans NSString * chemin1,Comment obtenir l'image d'un chemin dans UITAbleViewCell?

/Users/srikanth/Library/Application Support/iPhone Simulator/User/Applications/9E6E8B22-C946-4442-9209-75BB0E924434/Documents/snook.jpg 

Comment puis-je montrer l'snook.jpg d'image. j'ai besoin de montrer à UITableViewCell pour

cell.imageView.image 

si chemin1 a le chemin. J'ai utilisé ce qui suit pour obtenir la dernière partie du chemin1, snook.jpg.

NSURL *url = [NSURL URLWithString:path1]; 
NSString *imageString = [url path]; 

Mais, l'URL est affichée comme nulle.
Comment puis-je le faire? Merci.

Répondre

1

Si vous avez le chemin, vous pouvez utiliser la fonction "imageWithContentsOfFile:" méthode de UIImage:

UIImage *img = [UIImage imageWithContentsOfFile:path]; 
cell.imageView.image = img; 
Questions connexes