Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iphone mapview上的远程pinimage_Iphone_Objective C_Annotations_Mapkit - Fatal编程技术网

iphone mapview上的远程pinimage

iphone mapview上的远程pinimage,iphone,objective-c,annotations,mapkit,Iphone,Objective C,Annotations,Mapkit,我想在地图视图中将远程图像显示为PIN。我尝试了这种方法,但不起作用 annotationView.image = resizedImage; annotationView.opaque = NO; UIImageView *sfIconView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"here the image URL"]]; imageNamed从本地应用程序包中获取一个文件 你想要: UIImageView

我想在地图视图中将远程图像显示为PIN。我尝试了这种方法,但不起作用

annotationView.image = resizedImage;
annotationView.opaque = NO;
UIImageView *sfIconView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"here the image URL"]];

imageNamed从本地应用程序包中获取一个文件

你想要:

UIImageView *sfIconView = [[UIImageView alloc] initWithImage:[UIImage imageWithData:[NSData dataWithContentsOfURL:@"here is the image URL"]]];
但我不建议这样做,因为这样会阻塞主UI线程。应该首先考虑为PIN异步加载图像数据。