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.
精彩评论