AGSPopupMediaInfo如何访问位于设备本地的图片

用户希望通过Popup控件访问位于本地的图片,但是接口中需要传入的是图片的url地址,对于本地图片该如何访问?
已邀请:

马克玲

赞同来自:

【解决办法】:
访问本地图片的样例代码:
NSString *imagePath = [[NSBundle mainBundle] pathForResource:@Argentina ofType:@png];

//Concatenating file:// with the image path
NSMutableString* localUrl = [NSMutableString stringWithString: @file://];
[localUrl appendString:imagePath];

//Check the image local URL
NSLog(@%@,localUrl);

AGSPopupInfo *info = [AGSPopupInfo popupInfoForGraphic:graphic];
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:localUrl, @sourceURL, nil];

要回复问题请先登录注册