English 中文(简体)
How do I open an Excel file while working with iphone simulator?
原标题:

How do I open an Excel file while working with iphone simulator?

问题回答

I am not sure, but you can try to use loadData: method of UIWebView with mimetype @"application/excel".

I think Morion is right that you can open an Excel file in a UIWebView, but that might not work in the Simulator, and I m not sure how well you could programmatically extract the information you want to add to the ABAddressBook.

Perhaps you want to save the Excel file as a CSV file? Then you can include it as a resource in your application and parse the contents quite easily?

Or do you want the user to be able to specify an arbitrary Excel file?

There is a good tutorial available here which demonstrates how to open .pdf, .xls files in your application.

The main class you have to refer for this is QLPreviewController. here

This is the Datasource Method you would have to call for that

- (id <QLPreviewItem>)previewController: (QLPreviewController *)controller previewItemAtIndex:(NSInteger)index 
{
   // Break the path into it s components (filename and extension)
   NSArray *fileComponents = [[arrayOfDocuments objectAtIndex: index] componentsSeparatedByString:@"."];

  // Use the filename (index 0) and the extension (index 1) to get path

  NSString *path = [[NSBundle mainBundle] pathForResource:[fileComponents objectAtIndex:0] ofType:[fileComponents objectAtIndex:1]];

 return [NSURL fileURLWithPath:path];
}

Also someone would like to refer this SO question :iPhone - Opening word and excel file without using UIWebview.





相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签