Problem with FeatureLayer

279
1
12-01-2011 01:37 PM
CsabaHuszár
New Contributor
Hi
I have problem with FeatureLayer.(same as here: http://forums.arcgis.com/threads/30577-NO-types-or-templates-for-editable-FeatureLayer)

I implemented this:
NSURL* url = [NSURL URLWithString:@"...FeatureServer/0"];  
    AGSFeatureLayer* featureLayer = [[AGSFeatureLayer alloc]initWithURL:url mode:AGSFeatureLayerModeSnapshot];

NSMutableArray *grap=[[NSMutableArray alloc]init];
    grap=featureLayer.graphics;
    NSLog(@"%d",grap.count);

And grap.count is 0. What is the problem?  Mess up anything?

Thanks for the answer!
0 Kudos
1 Reply
CsabaHuszár
New Contributor
I have the answer:)

You must init with this method:
- (id)initWithURL:(NSURL*)url mode:(AGSFeatureLayerMode)mode error:(NSError**)error;

/** Initialize this layer, in a synchronous fashion, with a URL of an ArcGIS Server Map or Feature
Service layer.
@param url URL to a map or feature service layer.
@param mode The mode in which to retrieve features.
@param cred <code>AGSCredential</code> used to access secure resource.
@param error Information about the error returned if init fails.
@return A new feature layer object.
@since 1.0
*/
0 Kudos