I have two sets of data I am trying to copy to clipboard. An audio file and a string. I can't get to copy them both, but each individually works. Here is the code I have to set the data and copy it:
.h
@property NSData *previewData;
@property NSString *linkData;
.m
NSArray *preview = [JSON valueForKeyPath:@"results.previewUrl"];
NSArray *linkData = [JSON valueForKeyPath:@"results.url"];
_previewData = [NSData dataWithContentsOfURL:[NSURL URLWithString:[preview objectAtIndex:0]]];
_linkData = [linkData objectAtIndex:0];
// Need to combine these two lines
[pasteboard setData:_previewData forPasteboardType:@"public.mpeg-4-audio"];
pasteboard.string = _linkData;