views:

213

answers:

2

I want to code a small tabbed browser just for the fun. However I'm not sure how the tabbed thing works.

So this might be a noobish question:

can I store a current webView in an array? using: [array addObject:webView];

and if yes how do I load it into the webView again? maybe using: webView = [array objetAtIndex:anIndex]; will it appear instantly?

and is it possible to store the webView in and NSDictionary as value? (would be much easier to retrieve)

Thanks in advance

A: 

You can store anything you want in an array (or dictionary). So assuming youll have n WebViews for n tabs, (this might take up a lot o f memory, i dont know never tried it), when user clicks on a tab, you can do something like

[activeWebView removeFromSuperView]
activeWebView=[webViewArray objectAtIndex:tabIndex];
//then add the active web view to the view controller
Daniel
I tried that just now. [mainDrowser.webView removeFromSuperview]; mainDrowser.webView = [mainDrowser.arrayForTest objectAtIndex:0]; [mainDrowser.view addSubview:mainDrowser.webView]; NSLog(@"arrayForTest2: %@", mainDrowser.arrayForTest);but the "saved" data didn't show up in the webView (only the current page)btw. this is what is in my array<UIWebView: 0xd2e090; frame = (0 0; 320 460); clipsToBounds = YES; autoresize = W+H; layer = <CALayer: 0xd2b5a0>>
Yllier
PS: thanks for trying to help
Yllier
Whats this "saved" data
Daniel
it looks likes the content won't be saved in the array :( only the properties of the view.
Yllier
A: 

can you help me? i want to make an tabbed browser for the iphone.. does anyone have a working solution to store uiwebviews in an array?