DITAttachment
@interface DITAttachment : NSObject
Represents an attachment and can be used to insert the associated attachment into a document at a specific key.
-
The attachment’s metadata.
Declaration
Objective-C
@property (nonatomic, readonly) NSDictionary<NSString *, NSString *> *_Nonnull metadata;
-
Returns the attachment’s data.
Declaration
Objective-C
- (nullable NSData *)getData:(NSError *_Nullable *_Nullable)error;
Parameters
error
On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.
Return Value
The attachment’s data.
-
Copies the attachment to the specified file path.
Declaration
Objective-C
- (BOOL)copyToPath:(nonnull NSString *)path error:(NSError *_Nullable *_Nullable)error;
Parameters
path
The path that the attachment should be copied to.
error
On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.
Return Value
A boolean indicating whether or not the attachment file was successfully copied.