Instances of this class represent an attachment on the client. This is used with the AGSAttachmentManager
. This class automatically saves the attachment data to a temporary file and pulls the data out from that temporary file when needed. Thus, it does not store actual attachment data in memory. The temporary file is cleaned up when the AGSAttachmentManager
that is managing this attachment is cleared.
Public Member Functions | |
(NSData *) | - data |
(BOOL) | - existsOnServer |
(BOOL) | - isLocal |
(void) | - markForDeletion: |
(UIImage *) | - thumbnail |
Properties | |
AGSAttachmentInfo * | attachmentInfo |
AGSEditResultError * | editResultError |
AGSAttachmentEditState | editState |
NSString * | filepath |
BOOL | isDownloading |
NSError * | networkError |
- (NSData*) data |
If the attachment data has been downloaded, it will be saved to a temporary file. This method pulls the actual NSData from that file and returns it to the caller.
- (BOOL) existsOnServer |
Indicates whether the feature exists on the server or if it is only on the client at this point.
- (BOOL) isLocal |
Indicates whether the actual attachment data has been downloaded yet.
- (void) markForDeletion: | (BOOL) | del |
Marks the attachment for deletion. The attachment will not actually be deleted until the edits are synced with the server.
- (UIImage*) thumbnail |
Returns a thumbnail image the attachment. Only works with some types of attachments - mainly images and videos.
- (AGSAttachmentInfo*) attachmentInfo [read, retain] |
The attachment metadata associated with this attachment.
- (AGSEditResultError*) editResultError [read, retain] |
Error that occurred, if any, when the local edits were synced with the server for this attachment.
- (AGSAttachmentEditState) editState [read, assign] |
The edit state of this particular attachment.
- (NSString*) filepath [read, retain] |
The path to the temporary file that has been downloaded or saved. This will be nil if the attachment data has not been downloaded yet.
- (BOOL) isDownloading [read, assign] |
Indicates whether or not the data for this this attachment is currently downloading.
- (NSError*) networkError [read, retain] |
Network error that occurred, if any, when the attachment manager attempted to download data for this attachment or post edits for this attachment.