0
在此代码中,我想更改字符串创建为整数,并希望将其用于进一步处理。我怎样才能做到这一点? 这里的recordId isEqualToString:@“1”,我想改变这个字符串“1”为整数,然后想用它将字符串更改为整数iphone
-(void) parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName
namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName{
if (foundRecordId) {
NSLog(@"didEndElement: %@", recordId);
}
if ([recordId isEqualToString:@"1"]) {
NSLog(@"Only 1 account");
MainScreenController *mainScreen1 = [[MainScreenController alloc] initWithNibName:@"MainScreen" bundle:nil ];
self.mainScreen = mainScreen1;
[self.view addSubview: mainScreen1.view];
}
else if ([recordId isEqualToString:@"0"]){
NSLog(@"Accounts more than 1");
ChooseAccountsController *chooseAccount = [[ChooseAccountsController alloc] initWithNibName:@"ChooseAccountsController" bundle:nil];
self.chooseAcc = chooseAccount;
[self.view addSubview:chooseAccount.view];
}
}
非常感谢你:) – AppDeveloper