UIimageviewに表示され、1つずつ表示される配列に5つの画像があります。クリックされた特定の画像の画像データを取得し、タッチイベントを使用してWebビューにデータを表示したい.画像データを取得していません.私のコードはこちら
imgarr-> 5 種類の画像が含まれています
obj=[touches anyObject];
CGPoint point=[obj locationInView:self.view];
touchLocation=point;
if(CGRectContainsPoint([imgview frame],point))
{
//cloud.center=touchLocation;
NSData *imgData = UIImageJPEGRepresentation(imgview.image, 9.0);
UIImage *img = [UIImage imageWithData:imgData];
NSLog(@"selimg=%@",img);
for(int i=0;i<[imgarr count];i++)
{
UIImage *arr=[imgarr objectAtIndex:i];
NSData *arrdata=UIImageJPEGRepresentation(arr,9.0);
if(arrdata==imgData)
NSLog(@"True");
}
}
助けて..