Using UIPasteboard to share data with iOS Numbers App

427 views Asked by At

I'm wanting to share data in my app with iOS Numbers via the Pasteboard. I've written the following code: -

  NSData *data1 = [@"Col1,1\tCol1,2\n\nCol2,1\tCol2,2\n" dataUsingEncoding:NSASCIIStringEncoding];

[[UIPasteboard generalPasteboard] setData:data1 forPasteboardType:@"com.apple.iWork.TSPNativeData"];

However, when you use NSLog to check what's stored in the pasteboard - it's empty?

Initially I've tried using the basic code: -

[UIPasteboard generalPasteboard].string = @"Col1,1\tCol1,2\n\nCol2,1\tCol2,2\n";

However when that pastes into Numbers all the text is stored within one cell, rather than being outputted into the separate cells.

Has any one had any experiencing in trying to share data from their apps and Numbers?

Thanks,

Martyn

0

There are 0 answers