<?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 How to set up a definition expression? in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-set-up-a-definition-expression/m-p/514277#M4403</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Question update:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Which is the correct syntax to set a definition expression for "Identify" ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Resolved:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
NSString* defString = @"NAME='Mike'";
AGSLayerDefinition* layerDef = [AGSLayerDefinition&amp;nbsp; layerDefinitionWithLayerId:0 definition:defString];
identifyParams.layerDefinitions = [NSArray arrayWithObject: layerDef];
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a Map and a feature layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In my feature layer there are a lot of features created by different people.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There is a field "NAME" with the feature creator's name.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So, to show the features created only by, let's say "Mike" I am trying to use the following code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSURL *featLURL = [NSURL URLWithString:@"......"];
 self.featureLayer = [AGSFeatureLayer featureServiceLayerWithURL: featLURL mode: AGSFeatureLayerModeOnDemand];

 self.featureLayer.outFields = [NSArray arrayWithObject:@"*"];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [self.featureLayer setDefinitionExpression:@"NAME=???Mike???"];
 [self.mapView addMapLayer:self.featureLayer withName:@"featurez"];
 self.featureLayer.editingDelegate = self;
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;Doesn't work. Every feature just disappears from the map. (but they still can be identified)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any advices?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit 1:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;it does work like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt; NSString* defString = @"OBJECTID='1'"; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;But still doesn't work with strings.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit 2:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mkkkay, after restarting the service everything started working. Strange.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Question update:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Which is the correct syntax to set a definition expression for "Identify" ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Apr 2011 13:15:37 GMT</pubDate>
    <dc:creator>StanislavGusakov</dc:creator>
    <dc:date>2011-04-14T13:15:37Z</dc:date>
    <item>
      <title>How to set up a definition expression?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-set-up-a-definition-expression/m-p/514277#M4403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Question update:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Which is the correct syntax to set a definition expression for "Identify" ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Resolved:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
NSString* defString = @"NAME='Mike'";
AGSLayerDefinition* layerDef = [AGSLayerDefinition&amp;nbsp; layerDefinitionWithLayerId:0 definition:defString];
identifyParams.layerDefinitions = [NSArray arrayWithObject: layerDef];
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a Map and a feature layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In my feature layer there are a lot of features created by different people.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There is a field "NAME" with the feature creator's name.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So, to show the features created only by, let's say "Mike" I am trying to use the following code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSURL *featLURL = [NSURL URLWithString:@"......"];
 self.featureLayer = [AGSFeatureLayer featureServiceLayerWithURL: featLURL mode: AGSFeatureLayerModeOnDemand];

 self.featureLayer.outFields = [NSArray arrayWithObject:@"*"];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [self.featureLayer setDefinitionExpression:@"NAME=???Mike???"];
 [self.mapView addMapLayer:self.featureLayer withName:@"featurez"];
 self.featureLayer.editingDelegate = self;
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;Doesn't work. Every feature just disappears from the map. (but they still can be identified)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any advices?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit 1:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;it does work like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt; NSString* defString = @"OBJECTID='1'"; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;But still doesn't work with strings.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit 2:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mkkkay, after restarting the service everything started working. Strange.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Question update:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Which is the correct syntax to set a definition expression for "Identify" ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2011 13:15:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-set-up-a-definition-expression/m-p/514277#M4403</guid>
      <dc:creator>StanislavGusakov</dc:creator>
      <dc:date>2011-04-14T13:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up a definition expression?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-set-up-a-definition-expression/m-p/514278#M4404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The syntax is the same for all definition expressions, be it on layers or tasks (wherever supported).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2011 17:54:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-set-up-a-definition-expression/m-p/514278#M4404</guid>
      <dc:creator>DiveshGoyal</dc:creator>
      <dc:date>2011-04-19T17:54:05Z</dc:date>
    </item>
  </channel>
</rss>

