In this code I want to change the string founded to integer and want to use it for further processing. How can I do that?
Here the recordId isEqualToString:@”1″, I want to change this string “1” into integer and then want to use it
-(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];
}
}
You don’t need to do that. Just use NSString’s
intValuemessage.Your code will be something like: