Select to view content in your preferred language

Error Syncing Offline Attachment to arcGIS 10.2 in iOS

1313
1
Jump to solution
06-26-2014 12:50 AM
PranovKumar
New Contributor
Hi all,

i am working on a product which requires attachment to be synced to the offline ArcGIS server.

for this i am using the <AGSFeatureLayerEditingDelegate>

//Constructing the AgsFeature Object
agsFeature = [[AGSFeatureLayer alloc] initWithURL:[NSURL URLWithString:url] mode:AGSFeatureLayerModeOnDemand credential:[[DataManager sharedManager] getArcGISCredentials]];

//Assigning the delegate to self
agsFeature.editingDelegate = self;

//Performing the addAttachment
NSOperation *op = [agsFeature addAttachment:attachment.form.uId data:attachment.imageData filename:attachment.name];

but the problem here is that the NSopertion *op is returning 'nil'. and hence the callback to delegate is not happenening.

i am just stuck on it.
Any help suggestion would be of great help..! Thanks.!
0 Kudos
1 Solution

Accepted Solutions
DiveshGoyal
Esri Regular Contributor
Make sure you feature layer (agsFeature) is assigned to a strong property on the VC, otherwise it may get deallocated before the operation completes and the delegate won't be notified.

Here is a doc that describes how you can simplify the code for performing attachment operations on an AGSFeatureLayer using the AGSAttachmentManager class - https://developers.arcgis.com/ios/guide/working-with-the-attachment-manager.htm

View solution in original post

0 Kudos
1 Reply
DiveshGoyal
Esri Regular Contributor
Make sure you feature layer (agsFeature) is assigned to a strong property on the VC, otherwise it may get deallocated before the operation completes and the delegate won't be notified.

Here is a doc that describes how you can simplify the code for performing attachment operations on an AGSFeatureLayer using the AGSAttachmentManager class - https://developers.arcgis.com/ios/guide/working-with-the-attachment-manager.htm
0 Kudos