Creating readable XML for iOS - iphone

My client uses a process that uses XMLSS to create XML documents that can be opened in Microsoft Excel. In fact, simply renaming the files to .XLS, will ensure that the documents open in Excel by default. These documents are emailed to our clients. The documents open successfully in for Excel for PC and MAC, as well as OpenOffice (both platforms). It's a pretty nice solution.
The problem is, some of our clients have started attempting to open these documents (for viewing) on their iPhones and iPads (iOS devices), and it doesn't work. We know that iOS devices can open actual Office files, but since our documents are really just XML (and not true Excel files), the viewer on iOS doesn't want to view them. At least that's my guess.
We have played with sending these files with both XML and XLS extensions.
I'm aware of the option of using different techniques for building these documents such that they become true XLS files... but obviously, we're not eager to rewrite the entire application when most of our functionality remains just fine.
Any tips, ideas, suggestions?

Related

iPhone detects CSV as XLS

My app is able to import CSV files from within email attachments on the iPhone. Excel is used to generate the CSV files.
Initially I set the Document Type to public.comma-separated-values-text.
This works fine with Mac based CSV files. But when Windows based CSV files are emailed, the iPhone treats them differently. The quick view fails to work on them, and it labels them as .XLS files.
Sure enough, when I call [csvFilenameString pathExtension], it should return "CSV", but instead returns "XLS". But the actual filename extension IS ".csv"!
So to support this weirdness and still be able to read them in, I had to change my apps Document Type setting to public.data.
Of course now to iOS, my app looks like it's registered in supporting every file type for email attachments.
The only difference I could tell between the two CSV type files (Mac vs. Windows) is the EOL. Mac uses LF, while Windows uses CRLF.
Still, I'm thinking iOS should be smarter to detect it properly as a CSV and not as an XLS.
Anyone else experience this?

[iPhone]Have a way (or library) to create .doc files in iPhone app?

Have a way (or a library) to create .doc files in iPhone app ?
Short of writing your own library, you have two choices:
Use RTF, which will produce a Word-readable document that covers basic word processing features.
Send the data to a server, have the server do the conversion, then return the Word document to the application.

iOS text editor - save/load data model design?

I'm currently developing a simple text editor for iPad, and only save/load data parts are left. As a novice programmer, I don't have any experience with data managements in other languages and development environments. I researched on Core Data for a week and implemented a basic auto save/load feature in my app. But I have questions about better design of a text editor's data management such as saving text to *.txt files.
Which way is better? How do other text editors
1) Saving/Loading text as *.txt files
I found that in iOS 3.2 and later, the app can save and load (sync) texts as *.txt files into its local folder, so the users can load files in iTunes easily.
My question is that to implement save/load features, can I just save each text as *.txt file in my local folder and load them when launching my app? Specifically, can I just load titles of each *.txt file and load the entire NSString content only if the user clicks the specific file in UITableView??
So it doesn't use Core Data (or maybe Core Data is just used for a current text for auto save).
2) Core Data
Or using only Core Data is better approach? So when only the users want to save text to a *.txt file, the app saves a Core Data object or NSString content to *.txt file. In other words, unless the users manually save text as *.txt files, the users can't see any *.txt file in iTunes because Core Data internally saves them.
3) Both 1) + 2)
Would it better to save text as *.txt files and also using Core Data? I think it's just wasteful though.
Sorry for long questions. Thank you!
Apple strongly suggests in their Human Interface Guidelines that your users must not have "press save" to save, but rather saves should be automatic. At this point, iOS users do indeed expect that behavior. Core Data and autosave work really well together. (Core Data is also great for implementing Undo/Redo functionality as well.)
Therefore, I would suggest using Core Data as the app's internal format but offering the ability to export to other formats, like .txt. They are really not mutually exclusive methods. To export .txt files, you would create the .txt file in memory and then write it to your app's documents directory, which is what iTunes reads from. It's not very complicated.
Good luck!
I think you should use text files. So you can save space and sync into iTunes.

How to create a Word-like document (.docx) in an app?

I would like to create a .docx file within an iPad application. The file would be created within the app (the user would create/edit it like in Word--preferably with the same "feel" of Word) and then it would be saved as a .docx file.
So, is it possible to do this? If so, how? What other alternative file formats are there?
Thanks,
John
You can easily generate RTF corresponding to most typical features of a word processor. It will not cover the vastness of available DOCX features, but I'm not certain a complete port of Microsoft Word to the iPhone would be practical, so most of these features would be unavailable anyway.
RTF is fully (read-write) supported by Microsoft Office and several other editors.

How can I read documents from other iOS apps?

I have an app which is similar to an FTP client. I can download various types of documents in it. (DOC, XLS, PDF, PPT etc)
Now, I want to read those documents in another application. For example: Suppose I download a PDF in my app, it is possible to read from AirSharing or File Magnet?
I don't think it's possible for other applications to access Library folders owned by other apps, and definitely not private application folders.
Document handling might handle what you want only to an extent - not the files that don't have their types registered to any app, and only at a one by one file basis, essentially duplicating the files as well.
If this is your app you are talking about, you can implement the Open In feature which is part of the Document Interaction in iOS, which will allow the user to access the file in any app that is registered to handle the extension/UTI.
In particular, these methods:
UIDocumentInteractionController
– presentOpenInMenuFromRect:inView:animated:
– presentOpenInMenuFromBarButtonItem:animated: