Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-08-2011, 03:33 AM   #1 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 3
terwanerik is on a distinguished road
Default Loading UIWebView with UITabBar

Hi,
I have created an app that loads 4 html files (local) with a tabbar, so when i click the first tabbaritem it will load first.html and so on (till the fourth tab and fourth.html).

My problem is that when i startup the app it loads all the UIWebViews (so first.html till fourth.html) at the same time, i would want to load the UIWebView when i click on the tab, how do i do that?

Some of my code (firstviewcontroller.m):
Code:
@implementation FirstViewController

- (void)awakeFromNib
{
	
	[first setBackgroundColor:[UIColor clearColor]];
	
	NSString *urlAddress = [[NSBundle mainBundle] pathForResource:@"first" ofType:@"html"];
	
	NSURL *url = [NSURL fileURLWithPath:urlAddress];
	NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
	[first loadRequest:requestObj];
}

gr. Erik
terwanerik is offline   Reply With Quote
Old 01-08-2011, 03:41 AM   #2 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

use delegate uitabbar to load the request
Code:
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item{ 
}
or use viewDidAppear
Code:
-(void)viewDidAppear:(BOOL)animated { 
}
__________________
dany_dev is offline   Reply With Quote
Old 01-08-2011, 03:53 AM   #3 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 3
terwanerik is on a distinguished road
Default

Quote:
Originally Posted by dany88 View Post
use delegate uitabbar to load the request
Code:
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item{ 
}
or use viewDidAppear
Code:
-(void)viewDidAppear:(BOOL)animated { 
}
Thanks a lot! Problem fixed!

Last edited by terwanerik; 01-08-2011 at 03:56 AM.
terwanerik is offline   Reply With Quote
Old 01-08-2011, 03:54 AM   #4 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 3
terwanerik is on a distinguished road
Default

this post is useless mistake.

Last edited by terwanerik; 01-08-2011 at 03:56 AM.
terwanerik is offline   Reply With Quote
Reply

Bookmarks

Tags
loading, tabbar, uiwebview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 365
7 members and 358 guests
blueorb, fredidf, iAppDeveloper, iGamesDev, mottdog, sacha1996, Touchmint
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,667
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, host number one
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:32 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0