NSArray does not update its data second time I try to access it
<p>I am making a call to a web service, the results of the web service are in a form of a string, separated by delimiters.the result string is <code>1|101|Y|103|Y|105|Y|107|Y|109|Y|112|N|114|N|116|Y|</code></p>

<p>Now I tokenize the result string, the first token is 1, and based on this value I display the next menu.</p>

<p>If I do an invalid log in the result is <code>Error</code></p>

<p>and now second time if I enter the correct user name and password, the first token has a value of <code>Error1</code>.</p>

<p>How am I to get rid of the results obtained in case of invalid log in?
My loginController.m file is</p>

<pre><code> -(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
{
if( [elementName isEqualToString:@"return"])
{

 recordResults = FALSE;
 **NSArray *chunks=[soapResults componentsSeparatedByString:@"|"];**

 NSLog(soapResult);
 NSLog([chunks objectAtIndex:0]);//Second time on correct login, it displays in console as Error1

 if([[chunks objectAtIndex:0] isEqualToString:@"1"])
 {

  Menu *mv2 = [[Menu alloc] initWithNibName:@"Menu" bundle:nil];
  testAppDelegate *appdel=(testAppDelegate *)[[UIApplication sharedApplication]delegate];
  appdel.soapResult=self.soapResult;
  self.mv1=mv2;
  NSLog(appdel.soapResult);
  [self presentModalViewController:mv1 animated:YES];
  [mv1 release];

 }else {
  //[[chunks objectAtIndex:0] setText:@""];


  UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Sorry Invalid Login"
              delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];

  [alert show];
  [alert release];


  username_TextField.text=@"";
  password_TextField.text=@"";
   }


}
</code></pre>

<p>}</p>

<pre><code>- (void)dealloc 
{
[username_TextField release];
[password_TextField release];
[chunks release];
[super dealloc];
</code></pre>

<p>}</p>
