Navigation based iphone application
How would I go about creating a navigation based application that for each item in the list goes to a different website. Eg: Item 1 --->google. Item 2 --->stackoverflow. Item 3 --->facebook.
I am tried many things but cannot seem to get it working. I've looked at UICatalog but cannot think of how to im开发者_如何学JAVAplement what i need. A quick walkthrough would be great.
First you can take an array in that enter url list of arrays as follows:
NSArray *arr = [[NSArray alloc] initWithArray:@"Google",@"Stackoverflow",@"facebook",nil];
Then display these items first in tableviewcell.
After that add viewcontrollers, in that you can write the code what you want to show in that view using UIWebview
.
UIWebView *web = [[UIWebView alloc] initwithFrame:CGRectMake(0,0,320,460)];
NSString *str = @"http://google.com";
NSURL *url = [NSURL urlWithString:str];
NSURLRequest *req = [NSURLRequest requestWithURL:url];
[web loadRequest:req];
[self.view addSubView:web];
精彩评论