【发布时间】:2009-09-22 22:11:18
【问题描述】:
在登录屏幕之后,将用户名/密码发送到网络服务并返回 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];
}
【问题讨论】:
-
你是什么意思“卡住”你是在使用 gdb 来找出你“卡住”的地方吗?你的应用程序崩溃了吗?你做了回溯吗?在您粘贴的代码中,我也没有看到任何类型的 NSURLRequest 或任何连接到远程服务器的东西。
-
对不起,如果我不够清楚,我有它提出请求并收到答案就好了。我需要它做的是当它收到一个值是时,它需要将所有这些启动到主应用程序中。它这样做是为了客户安全,因此只有授权用户才能访问应用程序
-
soapResults 是来自网络服务的结束字符串。 True 表示授权成功。
标签: iphone cocoa-touch iphone-sdk-3.0