Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ajatakia

macrumors newbie
Original poster
Feb 1, 2012
1
0
Hello,
I have an encrypted word/excel/ppt file locally stored which I need to preview in my iPad app. I understand that QLPreviewController or UiDocumentInteractionController could be used to preview these files. I can very well use this

Code:
- (id <QLPreviewItem>) previewController: (QLPreviewController *) controller previewItemAtIndex: (NSInteger) index {

    return [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:[documents objectAtIndex:index] ofType:nil]];
}

But the file is encrypted and when I decrypt it I would get hold of NSData object. How do I go about loading NSData in either of these.

Also I understand that I can very well store the NSData back as a local file and load it in Preview. But there is a constraint of not storing the unencrypted file locally.

If someone has already accomplished this and can help me out here it will be greatly appreciated.

Thanks AJ
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.