我有一个提交按钮的用户登录页面,成功登录后我想转到下一个视图。为此,我打电话给web服务(这将验证来自后端数据库的数据)这将取决于成功或失败返回true或false.This工作正常;也就是说,我能得到使用的NSXMLParser值如下:根据SOAP消息值显示下一个视图
-(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
if (elementFound) {
soapResults = [string boolValue];
//NSLog(@"soapResultss = %@",soapResults);
}
if (soapResults)
{
x = 1; // x is 1 if username and password are correct.
}
else
{
x = 0;//x is 0 if username and password are incorrect
}
}
平均值,而(成功),我想这样调用下一个视图在我的“提交键”的方法:
if(x==0)
{
}
else if(x==1)
{
[self.navigationController pushViewController:self.viewController animated:YES];
}
但问题是,控制不回到“提交按钮单击”,即“其他如果”部分。而且,我认为这不是正确的方法。什么是正确的如何做到这一点?请建议。谢谢。
请澄清一下 “控制不回来了这种” 手段。 – trojanfoe 2013-02-13 12:38:49
更新了我的问题。 – bapi 2013-02-13 12:46:01
您需要在推送的视图控制器中创建自定义委托协议,并将原始视图控制器作为委托对象。这被用于在弹出时将状态返回到原始视图控制器。请参阅:http://stackoverflow.com/questions/11632043/use-of-delegates-to-communicate-between-view-controllers – trojanfoe 2013-02-13 12:50:16