Feature Attachments not saving in iOS 8.3 when running on hardware

3596
5
Jump to solution
04-23-2015 02:39 PM
MichaelDavis3
Occasional Contributor III

We are using a UIImagePickerController to capture photos and save as attachments.  Up until 8.3 everything was working fine, however when running in 8.3 on a device (iPad 4) the captured image is not added to the feature's attachments array when executing

[self.feature addAttachment:attachment];

and subsiquently not saved when executing

[self.feature.table safeFeature:self.feature error:&err];

where self.feature is a valid feature, and attachment is an AGSGDBAttachment created from the image.

This method continues to work fine on hardware running 8.2, and works fine in the simulator at 8.3.

Anyone else notice this issue?  Any idea what might be causing this behavior?

Matt Cooper

0 Kudos
1 Solution

Accepted Solutions
MichaelDavis3
Occasional Contributor III

False Alarm - Looks like this may have been due to a bad offline geodatabase download.  Cleared the geodatabase from the device and initiated a new one and things are working as expected.

View solution in original post

0 Kudos
5 Replies
MichaelDavis3
Occasional Contributor III

False Alarm - Looks like this may have been due to a bad offline geodatabase download.  Cleared the geodatabase from the device and initiated a new one and things are working as expected.

0 Kudos
GagandeepSingh
Occasional Contributor II

Hi Michael Davis​,

When you say UIImagePickerController, do you mean you are not using the AGSPopupsContainerViewController?

0 Kudos
MichaelDavis3
Occasional Contributor III

See my post above, problem resolved.

That said - we are not using AGSPopupsContainterViewController, we aren't using popups at all.  Our apps use UITableViews to present forms to the user for data collection.  Attachments are shown in a collection view, and a  UIImagePickerController is triggered to collect new pictures.

0 Kudos
GagandeepSingh
Occasional Contributor II

I did see your post. But I was just interested in knowing whats keeping you from not using the popups. If there is something we can improve on, to make you use the popups.

Tip:

If you have not tried the popups so far I would suggest you try the OfflineFeatureLayerEditing sample. You will notice that, in popups, we are also using UITableView to display fields and attachments. You can add attachments from the camera as well as the gallery. And all the logic for presentation and data management is built into the popups. So you don't have to worry about adding the attachment to the feature and a lot of other things.

0 Kudos
MichaelDavis3
Occasional Contributor III

Nothing wrong with Popups per se... Matt Cooper​ might be able to provide some additional insight, but primarily I'm not sure the popups would provide us with the flexibility we need for most of our more data intensive apps... which are quickly becoming all our apps.

For instance - we have a marine mammal monitoring app that field crews use for focal follow surveys (basically a boat follow a whale and records all their activity).  In this app the map is an important component, but the primary data entry interface is the data form.  For instance, our "sighting" UITable View is doing things like:

  • Listing attributes (27+ attributes) in sections with headers for better organization
  • Listing related focal follow points (anywhere from 1-100 points) inline in a table view section
  • Calculating offsets.  In this app a user collects the vessel position (lat/long) and enters a bearing and distance to the animal.  Once those values are entered into the form the app auto-calculates the location for the sighting and modifies the feature geometry.  The vessel location is retained in an attribute field.
  • Links to sub-forms.  Certain table rows change functionality depending on the corresponding attribute value.  For instance if the field crew check "Yes" for photos, the photo table row will be tap-able, and tapping it will push in a subform to collect information about the photos (camera, photographer, start-end frame).  These are all attributes in the primary feature table, but are not displayed in the main data form.

For our field users this automation and optimization is very important.  In some cases data collection is happening very rapidly and every second lost to a view transition annoys and delays them.

Being able to quickly scan a list view of all collected records is also very important.  Our field teams often use down-time to roll back over collected data to QC and add additional detail to field notes.  Being able to quickly scroll a list view sorted by date makes this much easier than tapping a map, trying to find the record you want in a bunch of overlapping points, and repeat...  This is actually one of our biggest pain points with Collector, no list view for navigating large data sets.

0 Kudos