Three ways for UIWebView to load local data in iOS development
- 2020-12-05 17:23:43
- OfStack
UIWebView is a built-in browser for IOS that allows you to browse web pages and open documents such as html/htm pdf docx txt. The safari browser is built using UIWebView.
The server puts MIME's identifier, etc., into the transmitted data and tells the browser which plug-in to use to read the relevant file.
uiwebview loads various local files (via the loadData method) :
UIWebView loads content in 3 ways:
1 Load the local data file
Specify MIMEType for the file
The encoding format is @" ES33en-8"
2 Load html string (all or part of html files can be loaded)
3 Load the NSURLRequest file (the first two steps are the same as NSURLConnect)