问题描述:

I am downloading a .m4a from a url on an iOS device then copying to clipboard. So far, this is what I have:

NSArray *preview = [JSON valueForKey:@"results.previewUrl"];

NSURL *previewUrl = [NSURL URLWithString:[preview objectAtIndex:0]];

NSData *previewData = [NSData dataWithContentsOfURL:previewUrl];

How do I copy that .m4a to clipboard? I believe there is a way to copy .mp3s and .mp4s (.m4a is same as .mp4).

results.previewUrl is http://a281.phobos.apple.com/us/r1000/119/Music/v4/f1/7b/d6/f17bd6e3-55c0-b7e0-9863-bc522900e950/mzaf_5153970109972844579.aac.m4a

网友答案:

I believe what you are interested in is UIPasteBoard. It seems to fit your needs. Check this gist for some examples

相关阅读:
Top