I have just built my project on several iOS 8 devices with baseSDK set to iOS 7.1. Unfortunately, all NSTextAttachment images added as attributes to relevant instances of NSMutableAttributedString are hidden on iOS 8 devices and the iOS 8 simulator (they are still visible on devices with 7.1 and the iOS 7.1 simulator). The frame for these strings within their superviews is set as if the image was there, but the image itself is just not visible or rendered.
Has anybody else ran into the issue of text attachments not appearing on iOS 8. If so, is there a workaround? If not, is there something wrong with my code (pasted below)? This instance in particular sets an attributed title for a UIButton, but I have other instances with attachments that are simple UILabels that are displaying the same behavior.
NSMutableAttributedString *attrButtonTitle = [[NSMutableAttributedString alloc] initWithString:@"Let's go!"];
NSTextAttachment *doubleArrowIcon = [[NSTextAttachment alloc] initWithData:nil ofType:nil];
doubleArrowIcon.image = [UIImage imageNamed:@"double-arrows"];
[attrButtonTitle appendAttributedString:[[NSAttributedString alloc] initWithString:@" " attributes:@{NSAttachmentAttributeName : doubleArrowIcon, NSBaselineOffsetAttributeName : @(-2)}]];
[self.nextButton setAttributedTitle:attrButtonTitle forState:UIControlStateNormal];
Note: I would post images to illustrate if I could, but I do not have the minimum stack overflow reputation to do so.