I have the following method, I have one more method through which I am calling this method, but have no luck yet.
- (void) parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName
namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName
attributes:(NSDictionary *)attributeDict{
if ([elementName isEqualToString:@"isphone-config"]) {
Pusername = [attributeDict valueForKey:@"authentication_username"];
Ppassword = [attributeDict valueForKey:@"authentication_password"];
Pidentity = [attributeDict valueForKey:@"sip_identity"];
Pdomain = [attributeDict valueForKey:@"domain"];
Pprotocol = [attributeDict valueForKey:@"protocol"];
Pudpport = [attributeDict valueForKey:@"registrar_port"];
Ptcpport = [attributeDict valueForKey:@"listening_port"];
NSLog(@"Title: %@, ID: %@", Pusername, Ppassword);
}
}
}
And I am calling it from the following method..
NSString* username = [[NSUserDefaults standardUserDefaults] stringForKey:@"username_preference"];
NSString* accountPassword = [[NSUserDefaults standardUserDefaults] stringForKey:@"password_preference"];
NSString* urlString = [NSString stringWithFormat:@"https://%@:%@@test.com/test.php",username,accountPassword];
NSURLRequest* request = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString]];
NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
parser = [[NSXMLParser alloc] initWithData: response];
NSLog(@"at parser %@", parser);
[parser setDelegate:self];
I am having issues in the last line of the code from where I am calling parser. I assume that this line will call the method parser, correct me if I am wrong. I don't know which files, interfaces and classes I have to import, include or implement.