Tuesday, 19 February 2013

Displaying Content in a Web View | iPhone Apps Tutorial pdf

Displaying Content in a Web View

If your user interface includes a UIWebView object, you can display local content or content that is loaded from the network. When loading local content, you can either create the content dynamically or load it from a file and display it using the loadData:MIMEType:textEncodingName:baseURL: or  loadHTMLString:baseURL: method. To load content from the network, you create an NSURLRequest object and pass it to the loadRequest: method of your web view.
If, after initiating a network-based load request, you must release your web view for any reason, you must cancel the pending request before releasing the web view. You can cancel a load request using the web view’s stopLoading method. A typical place to include this code would be in the viewWillDisappear:
method of the owning view controller. To determine if a request is still pending, you can check the value in the web view’s loading property.

No comments: