This article is a piece of my "iOS development Daily Small Notes" series, which is recorded in the development work today, can be explained with a short article or a small demo demo small tips. They may give the user experience, the code efficiency to get some improvement, or have not been in touch with the technology, very happy to learn, put here to be a little bit. The role of 90% is to help you review, remember, review.
About two years ago, I tried to write a program myself to parse a Word document. At that time filled with blood, think as long as the XML all kinds of label one by one correspondence parsing is good (at that time did not know coretext this thing). Later found that their strength is not enough, in the resolution of pictures, text, paragraphs, audio, video, left a rotten tail project.
Anything is need to persist to do a good job, perhaps I have been the ideal to persist in the analysis, and now may be able to release their own "WPS". OK, or not yy, began to record today's notes.
Today encountered a wonderful problem, first of all, we now open various formats of documents, are using Uidocumentinteractioncontroller. Use the "preview" method, such as HTML, TXT, Word, Excel, and so on. These can all be opened perfectly. But today I found out that Uidocumentinteractioncontroller can't open a local ibooks document in some way!
Take a look at my question code:
1 Uidocumentinteractioncontroller *controller = [Uidocumentinteractioncontroller interactioncontrollerwithurl: FILEURL]; 2 Controller. delegate = self ; 3 [Controller Presentpreviewanimated:yes];
With the above code, you can directly present a "preview" interface, HTML, TXT, Word, Excel are good support, but ibooks does not support!
If you want to open ibooks, you can only use the following methods:
1 Uidocumentinteractioncontroller *controller = [Uidocumentinteractioncontroller interactioncontrollerwithurl: FILEURL]; 2 Controller. delegate = self ; 3 [Controller Presentoptionsmenufromrect:rect InView:self.view Animated:yes];
This pops up first, which lists the third-party apps that might be supported, including the IBook app installed on the device. Click on it to jump to the ibook app and automatically load the ibooks file for the local FileURL address.
The reason for this effect, I think, is that because of the "preview" feature in iOS, Uidocumentinteractioncontroller does not support ibooks. Uidocumentinteractioncontroller only supports the use of third-party apps (that is, iOS's own ibook app) to open ibooks documents, so you can only use "Pop first, then select Open" To view ibooks documents. The disadvantage of this is that you must leave your application and jump to ibooks.
"iOS Development Daily Small notes (13)" Use Uidocumentinteractioncontroller to open a note for ibooks documents