s26761

AGSPopupMediaInfo

Discussion created by s26761 on Oct 22, 2015
Latest reply on Oct 24, 2015 by s26761

Hello

 

I've come back to this question again after a while. Still couldn't figure out how to set the correct path for an image (Logo.png - resource in local bundle) to be displayed in a popup. The code below doesn't work - keep showing "No image to display".

 

    AGSPopupInfo *info = [AGSPopupInfo popupInfoForGraphic:graphic];

    NSURL *url = [[NSBundle mainBundle] URLForResource:@"Logo" withExtension:@"png"];

    NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:url.path, @"sourceURL", nil];

    AGSPopupMediaInfo *mediaInfo = [AGSPopupMediaInfo popupMediaInfoWithTitle:@"Title" caption:@"Caption" type:AGSPopupMediaInfoTypeImage value:dict];

    info.mediaInfos = [NSArray arrayWithObject:mediaInfo];

    self.popupVC = [[AGSPopupsContainerViewController alloc] initWithPopupInfo:info graphic:graphic usingNavigationControllerStack:NO];

 

Thanks.

 

Rgds

Ong CF

Outcomes