我使用下面的代码转换到其他视图。实际上我必须从下载的xml数据中获取值,它就像 1或0 但它只显示其他部分,如果部分或行为不正常
请帮忙
-(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict
{
NSLog(@"Parser was called");
if ([elementName isEqualToString:@"userId"]&&[attributeDict valueForKey:@"1"])
{
NSLog(@"Succeeded");
MainScreenController *mainScreen1 = [[MainScreenController alloc] initWithNibName:@"MainScreen" bundle:nil ];
self.mainScreen = mainScreen1;
[self.view addSubview: mainScreen1.view];
}else {
NSLog(@"Go to account selection");
ChooseAccountsController *chooseAccount = [[ChooseAccountsController alloc] initWithNibName:@"ChooseAccountsController" bundle:nil];
self.chooseAcc = chooseAccount;
[self.view addSubview:chooseAccount.view];
}
}