Instance Method

addAttachmentURL:withAlternateFilename:

Attaches a specified file to the message.

Declaration

- (BOOL)addAttachmentURL:(NSURL *)attachmentURL withAlternateFilename:(NSString *)alternateFilename;

Parameters

attachmentURL

The file URL for the attachment. Must not be nil.

alternateFilename

If you supply a string here, the message UI uses it for the attachment. Use an alternate filename to better describe the attachment or to make the name more readable.

OK to use a nil value, in which case the attachment’s actual filename is displayed in the message UI.

Return Value

YES if the attachment at the specified URL was successfully added to the message, or NO otherwise.

Discussion

You can add zero or more attachments to a message before you display the message to the user. To access information about a message’s attachments, access the attachments property.

See Also

Managing Attachments

- disableUserAttachments

Disables the camera/attachment button in the message composition view.

attachments

Returns an array of dictionaries that describe the properties of an attachment.

- addAttachmentData:typeIdentifier:filename:

Attaches arbitrary content to the message.

MFMessageComposeViewControllerAttachmentURL

The URL for the item that is attached to the message.

MFMessageComposeViewControllerAttachmentAlternateFilename

The key for the alternate filename for the file-based item attached to the message.