在登录屏幕之后,将用户名/密码发送到web服务并获得true(应该启动应用程序的其余部分)或false(不正确的用户名/密码或未授权)的响应。该应用程序提供您已通过身份验证的警报视图,但它不会加载视图的其余部分吗?
if ([soapResults isEqualToString: @"true"])
{
UIAlertView *welcome = [[UIAlertView alloc] initWithTitle:@"Welcome!" message:@"Welcome, You are now authenticated to a Coyote Logistics application." delegate:self cancelButtonTitle:@"OK",nil otherButtonTitles:nil];
[welcome show];
[welcome release];
[soapResults release];
soapResults = nil;
[loginIndicator stopAnimating];
loginIndicator.hidden = TRUE;
loggedinLabel.text = usernameField.text;
loggedinLabel.textColor = [UIColor blackColor];
NSLog(@"Valid Login");
FeedsViewController *fvController = [[FeedsViewController alloc] initWithTitle:@"LoadBoard" withNavigationTitle:@"Available Loads" withPropertyFile:@"feeds.plist"];
AboutViewController *avController = [[AboutViewController alloc] init];
SettingsViewController *svController = [[SettingsViewController alloc] init];
UINavigationController *fvNavController = [[UINavigationController alloc] initWithRootViewController:fvController];
UINavigationController *avNavController = [[UINavigationController alloc] initWithRootViewController:avController];
UINavigationController *svNavController = [[UINavigationController alloc] initWithRootViewController:svController];
UITabBarController *tbController = [[UITabBarController alloc] init];
fvNavController.navigationBar.tintColor = [UIColor colorWithRed:0.14 green:0.18 blue:0.25 alpha:1.00];
avNavController.navigationBar.tintColor = [UIColor colorWithRed:0.14 green:0.18 blue:0.25 alpha:1.00];
svNavController.navigationBar.tintColor = [UIColor colorWithRed:0.14 green:0.18 blue:0.25 alpha:1.00];
[[fvController tabBarItem] setImage:[UIImage imageNamed:@"rss.png"]];
tbController.viewControllers = [NSArray arrayWithObjects:fvNavController, avNavController, svNavController, nil];
// Configure and show the window
[window addSubview:tbController.view];
[window makeKeyAndVisible];
[LoginViewController release];
}
请帮助我
答案 0 :(得分:1)
禁用UIAlertView的显示会发生什么?如果加载正确,您可能需要考虑在第一个可见viewcontroller的viewdidload方法中移动UIAlertView的显示。