开发者

remote pinimage on an iphone mapview

i want to display remote images as pins on my map view i tried this way but this dont work

a开发者_JAVA百科nnotationView.image = resizedImage;
annotationView.opaque = NO;
UIImageView *sfIconView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"here the image URL"]];


imageNamed takes a file from your local application bundle.

You want:

UIImageView *sfIconView = [[UIImageView alloc] initWithImage:[UIImage imageWithData:[NSData dataWithContentsOfURL:@"here is the image URL"]]];

I don't recommend doing it this way though because it'll block the main UI thread. You should consider loading the image data for your pin asynchronously first.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜