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 06-16-2010, 09:29 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2010
Location: Little Rock, AR
Posts: 1
KeithYohn is on a distinguished road
Default Dismiss LoginView and load TabBar WebView URLs ??

I have created a TabBarController application that currently has two tabs. Each tab contains a WebView. of course each webview opens a certain web page. The site that the webviews connect to require the use to be logged in.

To take care of the login, I have created a LoginViewController. I use presentModalViewController from the appDelegate to open the login screen.

Code:
	LoginViewController *lvc = [[LoginViewController alloc] initWithNibName:@"LoginViewController" bundle:nil];
	lvc.delegate = self;
	[self.tabBarController presentModalViewController:lvc animated:NO];
	[lvc release];
I then use an HTTP POST to check the login information and use the response from the webpage to see if the login credentials are valid. Once the credentials have been validated, I remove the LoginView using dismissModalViewControllerAnimated.

Code:
- (void)loginViewControllerDidFinish:(LoginViewController *)loginViewController
{
	[self.tabBarController dismissModalViewControllerAnimated:YES];
}
The problem I am having is that my TabBarController is loaded when the app is loaded and therefore the webview content is loaded when the app is loaded. This happens before the login credentials have been submitted and therefore the web pages that are being loaded into the WebViews are redirected back to the login page of the web site.

So, my questions are:
  • What is the best way to handle this situation? Should I not be loading the TabBar controller at app launch and displaying the login page as a modal view?
  • Is there a way to tell the WebView to load a certain URL from the tabBarController didSelectViewController method?
  • What method should I use to load the URL in the WebView? awakeFromNib, viewDidLoad, viewWillAppear, etc.?

I am open to all ideas. I am pretty new to iPhone development. I have read everything I could find on this topic and searched the internet. This issue has had me stuck all day now.

Please help.

Keith

Last edited by KeithYohn; 06-17-2010 at 10:49 AM.
KeithYohn is offline   Reply With Quote
Reply

Bookmarks

Tags
loginviewcontroller, tabbarcontroller, webview

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: 325
8 members and 317 guests
Absentia, Domele, fiftysixty, givensur, heshiming, michaelhansen, PixelInteractive, Sloshmonster
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,892
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

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