<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Trouble with AGSAttachmentManagerDelegate in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/trouble-with-agsattachmentmanagerdelegate/m-p/481807#M4106</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you try doing this : &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

-(void)attachmentManager:(AGSAttachmentManager *)attachmentManager didDownloadAttachmentInfos:(NSArray *)attachmentInfos
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; for(AGSAttachmentInfo *info in attachmentInfos)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [attachmentManager downloadAttachmentDataForId:info.attachmentId];
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 21:15:37 GMT</pubDate>
    <dc:creator>DiveshGoyal</dc:creator>
    <dc:date>2021-12-11T21:15:37Z</dc:date>
    <item>
      <title>Trouble with AGSAttachmentManagerDelegate</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/trouble-with-agsattachmentmanagerdelegate/m-p/481806#M4105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm having some trouble with the AGSAttachmentManager downloading attachments. The following methods are all in a ViewController that implements AGSAttachmentManagerDelegate, but when it runs, the delegate methods don't fire. I've tried adding calls to retain, in case it was an issue with the manager getting prematurely cleaned up, but that doesn't appear to be what's happening. This happens with calls to a feature that definitely has an attachment visible in REST.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a reason why the first function in this code would run but the second two wouldn't?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
-(void)setSelectedGraphic:(AGSGraphic *)selectedGraphicValue
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; _selectedGraphic = selectedGraphicValue;
&amp;nbsp;&amp;nbsp;&amp;nbsp; [self.relatedTableFeatureLayer clearAttachmentManagers];
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSAttachmentManager *am = [[self.relatedTableFeatureLayer attachmentManagerForFeature:_selectedGraphic] retain];
&amp;nbsp;&amp;nbsp;&amp;nbsp; am.delegate = self;
&amp;nbsp;&amp;nbsp;&amp;nbsp; [am downloadAttachmentInfos];
}


-(void)attachmentManager:(AGSAttachmentManager *)attachmentManager didDownloadAttachmentInfos:(NSArray *)attachmentInfos
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; for(InspectionFormViewController *controller in self.viewControllers)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; controller.attachments = [NSMutableArray array];
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; for(AGSAttachmentInfo *info in attachmentInfos)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSAttachmentManager *am = [[self.relatedTableFeatureLayer attachmentManagerForFeature:self.selectedGraphic] retain];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; am.delegate = self;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [am downloadAttachmentDataForId:info.attachmentId];
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; //[attachmentManager release];
}

-(void)attachmentManager:(AGSAttachmentManager *)attachmentManager didDownloadDataForAttachment:(AGSAttachment *)attachment
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; for(InspectionFormViewController *controller in self.viewControllers)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [controller.attachments addObject:attachment];
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; //[attachmentManager release];
}

&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 20:29:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/trouble-with-agsattachmentmanagerdelegate/m-p/481806#M4105</guid>
      <dc:creator>DanielMonego</dc:creator>
      <dc:date>2012-11-15T20:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with AGSAttachmentManagerDelegate</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/trouble-with-agsattachmentmanagerdelegate/m-p/481807#M4106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you try doing this : &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

-(void)attachmentManager:(AGSAttachmentManager *)attachmentManager didDownloadAttachmentInfos:(NSArray *)attachmentInfos
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; for(AGSAttachmentInfo *info in attachmentInfos)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [attachmentManager downloadAttachmentDataForId:info.attachmentId];
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:15:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/trouble-with-agsattachmentmanagerdelegate/m-p/481807#M4106</guid>
      <dc:creator>DiveshGoyal</dc:creator>
      <dc:date>2021-12-11T21:15:37Z</dc:date>
    </item>
  </channel>
</rss>

