Operating system requirements: iOS 5.0 or later.
Mobile device: iPad.
This example describes some methods of working with web page view. After starting the example the following operations are executed:
A web page view controller is created.
HTTP class of the page that should be displayed is determined.
Dashboard text and composite block are set that correspond to web page.
The mobile device screen displays web page, text and name of the composite block related to the web page.
Executing the example requires to place the following code in the body of the executeExample method of the ViewController class (see the Displaying of Dashboard section):
// Get dashboard controller MADashboardReportViewController *dashboard = (MADashboardReportViewController *)m_controller; // Get dashboard APKap *kap = [dashboard report]; // Create a controller for displaying web page MAWebDataViewController *webCtrl = [dashboard createWebDataViewController]; // Specify web page URL [webCtrl setUrl:@"http://www.example.com/sites/default/image/image.png"]; // Set [webCtrl setText:@"Prognoz"]; // Get last composite block APCompositeBlock *block = [[[kap compositeBlocks] allValues] objectAtIndex: ([[kap compositeBlocks] count] - 1)]; // Link obtained block to web page view [webCtrl setContr:block]; // Load web page [webCtrl loadView]; // Display text that is set for web page view [[webCtrl navigationItem] setTitle:[webCtrl text]]; // Display composite block title NSString *blockTitle = [kap titleForCompositeBlock:[[webCtrl contr] key]]; [[webCtrl navigationItem] setPrompt: blockTitle]; // Display web page view [self showViewControllerInNavigationController: webCtrl];
After executing the example the web page with image, the text and name of the related composite block are displayed:
See also: