I am using the following code to generate and parse the XML.
The method [self checksigninSucess];
is called and the UITextField
values are set while pressing a "Sign IN" button.
-(void)checksigninSucess{
NSString* content = [NSString stringWithFormat:@"http://www.anball/login_check.php?email=%@&password=%@",emailField.text,passwordField.text];
NSData *xml = [NSData dataWithContentsOfURL: [NSURL URLWithString:content]];
NSLog(@"URLXML %@",[NSURL URLWithString:content]);
self.parser=[NSXMLParser alloc]initWithData:xml];
[self.parser setDelegate:self];
[self.parser parse];
[self.parser release];
self.parser=nil;
}
But my problem is that NSData
holds the values which I enter in the text fields for the first time only. When I press the "Sign In" button for the second time with different email and password , NSData
holds the same URL it generated before.
How can I clear the values held by NSData
for the next try.