1

I want to retrieve a word document through a web service call in Objective-C.

I have three question on this task:

  1. How to retrieve the word document from a webservice call in Objective-C. (Inside the webservice I retrieve the document through a database call as the word document is stored in the database).
  2. How can I store it in the sand box after retrieval ?
  3. How to open the word document in Objective-C?
Alex Wayne
  • 178,991
  • 47
  • 309
  • 337
Ashok Ambrose
  • 191
  • 3
  • 17

3 Answers3

0
  1. Like any other binary file: eg pdf
  2. Save it...an example
  3. you can open as binary and it will be hard to display properly, but I am sure there are word viewer apps, and you can open with they.
Community
  • 1
  • 1
  • To add to that last point, there's a tech note that lists the file formats that a UIWebView can display. It includes newer versions of MSWord: http://developer.apple.com/library/ios/#qa/qa1630/_index.html#//apple_ref/doc/uid/DTS40008749 – Phillip Mills Dec 07 '12 at 01:36
0
  1. For retrieving a document I would use a networking library such as AFNetworking
  2. Then you can store it on you app Documents folder (check this out)
  3. The you can show your document using the Quicklook features of iOS. You may want to take a look at the Document Interaction Programming Guide
Community
  • 1
  • 1
Gabriele Petronella
  • 106,943
  • 21
  • 217
  • 235
0

Take a look at the QuickLook.framework. That can read all MS Office formats. Also can print from a supported AirPrint printer. https://developer.apple.com/library/ios/documentation/QuickLook/Reference/QuickLookFrameworkReference_iPhoneOS/

Example:- http://kratinmobile.com/blog/index.php/document-preview-in-ios-with-quick-look-framework/

pkc456
  • 8,350
  • 38
  • 53
  • 109