<?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 Potential ARC problem with AGSRequestOperation sharedOperationQueue in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/potential-arc-problem-with-agsrequestoperation/m-p/463740#M3978</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Good morning,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been developing a set of custom classes that access a very custom, WMTS-like web service and have come across a rather pesky and intermittent runtime error. During execution in the simulator for iPhone or iPad I randomly receive the an EXC_BAD_ACCESS exception during startup of my application. I ran profiler and believe I have determined that the AGSRequestOperation sharedOperationQueue is getting cleaned up by ARC before it should be. Using a Zombie notifies me that a message was sent to a deallocated object. Further inspection indicates the exception is occurring when I'm trying to add an operation to the sharedOperationQueue. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, since this is wrapped up in the SDK, I decided to try a little test and downloaded the CustomTiledLayerSample project from your website to check it's behavior. After running it a few times it started to exhibit the same exception-throwing behavior in the exact same place. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can someone please take a look at this and get back to me ASAP? I've been delaying delivering an application based what appeared to be new functionality in 10.1.1 and not I'm stuck between a rock and a hard place.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jon&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Mar 2013 13:29:12 GMT</pubDate>
    <dc:creator>JonDowney</dc:creator>
    <dc:date>2013-03-22T13:29:12Z</dc:date>
    <item>
      <title>Potential ARC problem with AGSRequestOperation sharedOperationQueue</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/potential-arc-problem-with-agsrequestoperation/m-p/463740#M3978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Good morning,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been developing a set of custom classes that access a very custom, WMTS-like web service and have come across a rather pesky and intermittent runtime error. During execution in the simulator for iPhone or iPad I randomly receive the an EXC_BAD_ACCESS exception during startup of my application. I ran profiler and believe I have determined that the AGSRequestOperation sharedOperationQueue is getting cleaned up by ARC before it should be. Using a Zombie notifies me that a message was sent to a deallocated object. Further inspection indicates the exception is occurring when I'm trying to add an operation to the sharedOperationQueue. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, since this is wrapped up in the SDK, I decided to try a little test and downloaded the CustomTiledLayerSample project from your website to check it's behavior. After running it a few times it started to exhibit the same exception-throwing behavior in the exact same place. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can someone please take a look at this and get back to me ASAP? I've been delaying delivering an application based what appeared to be new functionality in 10.1.1 and not I'm stuck between a rock and a hard place.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jon&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2013 13:29:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/potential-arc-problem-with-agsrequestoperation/m-p/463740#M3978</guid>
      <dc:creator>JonDowney</dc:creator>
      <dc:date>2013-03-22T13:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Potential ARC problem with AGSRequestOperation sharedOperationQueue</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/potential-arc-problem-with-agsrequestoperation/m-p/463741#M3979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Good morning,&lt;BR /&gt;&lt;BR /&gt;Can someone please take a look at this and get back to me ASAP? I've been delaying delivering an application based what appeared to be new functionality in 10.1.1 and not I'm stuck between a rock and a hard place.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Jon&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not ESRI, but I saw the same crash when I looked at the custom tiled layer sample and I was able to find a quick workaround to the crash. &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/runtime-ios-sdk/apiref/interface_a_g_s_request_operation.html#"&gt;[AGSRequestOperation sharedOperationQueue]&lt;/A&gt;&lt;SPAN&gt; simply returns a subclass of &lt;/SPAN&gt;&lt;A href="https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSOperationQueue_class/Reference/Reference.html"&gt;NSOperationQueue&lt;/A&gt;&lt;SPAN&gt;. If you create an &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;NSOperationQueue&lt;/SPAN&gt;&lt;SPAN&gt; and substitute that for the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;sharedOperationQueue&lt;/SPAN&gt;&lt;SPAN&gt; call, everything runs smoothly. I'm not sure what kind of operation throttling, etc. &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;sharedOperationQueue&lt;/SPAN&gt;&lt;SPAN&gt; normally does in response to other stuff going on with the Runtime SDK, but I saw no difference in behavior of the sample app, except that the intermittent crashing went away. If you need to ship this ASAP, probably worth a shot. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I attached an edited version of the sample, with &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;sharedOperationQueue&lt;/SPAN&gt;&lt;SPAN&gt; swapped out for an &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;NSOperationQueue&lt;/SPAN&gt;&lt;SPAN&gt;. Prior to swapping out the queues, I was seeing crash on layer load about 30% of the time. After swapping, I built, ran, and interacted with the modified sample 12 times and saw no crashing or other issues.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2013 16:22:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/potential-arc-problem-with-agsrequestoperation/m-p/463741#M3979</guid>
      <dc:creator>DanaMaher</dc:creator>
      <dc:date>2013-03-22T16:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: Potential ARC problem with AGSRequestOperation sharedOperationQueue</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/potential-arc-problem-with-agsrequestoperation/m-p/463742#M3980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You may not be ESRI but you just may have saved my day!!! I haven't had time to thoroughly test the solution but at first glance it seems to be working as planned. I've ran it about 30 times and performed plenty of map operations without fail. Thank you!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did have a comment: shouldn't we update the cancelRequestForKey: function to use the local requestQueue object and not the sharedOperationQueue? Seems like we may be putting operations into one queue and canceling them from another.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2013 17:00:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/potential-arc-problem-with-agsrequestoperation/m-p/463742#M3980</guid>
      <dc:creator>JonDowney</dc:creator>
      <dc:date>2013-03-22T17:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: Potential ARC problem with AGSRequestOperation sharedOperationQueue</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/potential-arc-problem-with-agsrequestoperation/m-p/463743#M3981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;I did have a comment: shouldn't we update the cancelRequestForKey: function to use the local requestQueue object and not the sharedOperationQueue? Seems like we may be putting operations into one queue and canceling them from another.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, I missed that. All queue interactions should now point to the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;NSOperationQueue&lt;/SPAN&gt;&lt;SPAN&gt; instance. Glad I could help. You might mark the thread as answered if this turns out to be workable after further testing.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2013 17:03:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/potential-arc-problem-with-agsrequestoperation/m-p/463743#M3981</guid>
      <dc:creator>DanaMaher</dc:creator>
      <dc:date>2013-03-22T17:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: Potential ARC problem with AGSRequestOperation sharedOperationQueue</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/potential-arc-problem-with-agsrequestoperation/m-p/463744#M3982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think I face the same bug but at another place.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In some use-cases of my app, I need to call :&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;NSOperation *nsOp = [featureLayer addFeatures:graphics]&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I call this immediately after map creation, I end up (not always, but VERY often) with an EXC_BAD_ACCESS. When I call this after a while, I generally have an operation which is never executed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think there are some problems with operation queueing... But since I am not queuing the operation myself (it is internally queued by the "addFeatures" call and it returns the queued NSOperation), I cannot use your workaround.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried to add an Objective-C category on AGSRequestOperation so that sharedOperationQueue returns one of my own allocated operation queue. For now it seems to work. But note that it seems not to work with a static variable, don't know why. &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;@implementation AGSRequestOperation (Operation)

+ (NSOperationQueue *)sharedOperationQueue {
&amp;nbsp;&amp;nbsp;&amp;nbsp; return [Utils getQueue];
}
@end&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And the Utils code : &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
// Declaration in .h file
@property (nonatomic,strong) NSOperationQueue *operationQueue;

@implementation Utils

- (id)init
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; self = [super init];
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (self) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _operationQueue = [[NSOperationQueue alloc] init];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [_operationQueue setMaxConcurrentOperationCount:10];
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; return self;
}

+ (NSOperationQueue *)getQueue {
&amp;nbsp;&amp;nbsp;&amp;nbsp; return _operationQueue;
}
@end&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Actually, I don't really know what arcgis does internally to schedule this task. All I know is that there is something not good regarding object allocation / retain thing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need some more tests to make sure that it works ALL the time. That would be great to have inputs from an ArcGis guy and to investigate on a fix.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Christophe.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:35:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/potential-arc-problem-with-agsrequestoperation/m-p/463744#M3982</guid>
      <dc:creator>ChristopheFondacci</dc:creator>
      <dc:date>2021-12-11T20:35:43Z</dc:date>
    </item>
  </channel>
</rss>

