This code snippet is a category of NSAttributedString that shows how to fetch all attachments from the string.
Header:
@interface NSAttributedString (NSAttributedString_MoreExtensions)
/** * @method allAttachments * @abstract Fetchs all attachments from an NSAttributedString. * @discussion This method searchs for NSAttachmentAttributeName attributes within the string instead of searching for NSAttachmentCharacter characters. */ - (NSArray *)allAttachments;
@end
Source:
@implementation [...]