ios - Listview to uiwebview? -


i can create list of 5 websites in listview how this..

on clicking 1 of items in list should take me uiwebview display url within app button listview?

is there example or tutorial this?

thanks

attempt follows: (sites don't appear in table list - trying make them appear , clickable open internally in app)

a tableview named "sites" has been added tab on app.

tabcontroller.m

- (void)tableview:(uitableview *)sites didselectrowatindexpath:(nsindexpath *)indexpath {     switch(indexpath.row)     {         case 0:[[uiapplication sharedapplication] openurl:[nsurl urlwithstring:@"www.google.com"]];             break;          case 1:[[uiapplication sharedapplication] openurl:[nsurl urlwithstring:@"www.facebook.com"]];             break;          case 2:[[uiapplication sharedapplication] openurl:[nsurl urlwithstring:@"www.google.com"]];             break;           case 3:[[uiapplication sharedapplication] openurl:[nsurl urlwithstring:@"www.yahoo.com"]];             break;          case 4:[[uiapplication sharedapplication] openurl:[nsurl urlwithstring:@"www.msn.com"]];             break;                    }  } 

tabcontroller.h

@interface tabcontroller : uiviewcontroller {      iboutlet uitableview *sites;  } 

load webview url

nsstring *urladdress = @”http://www.google.com”; //create url object. nsurl *url = [nsurl urlwithstring:urladdress]; //url requst object nsurlrequest *requestobj = [nsurlrequest requestwithurl:url]; //load request in uiwebview. [webview loadrequest:requestobj]; 
  1. create 2 viewcontrollers
  2. first populate tableview showing urls,
  3. one second vc add uiwebview , create iboutlet
  4. on did select tableview method push second viewcontroller ,pass url
  5. use above code in second view controller load webview url

Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -