title: Clear UITextfield Data when coming to that page again iphone
body: <p>I have some dynamically allocated texfields and in which i am entering the text,</p>
  
  <p>Now i have got two problems here 
  1) After 2-3 button clicks, i mean changing the views and coming back to the same view than the data is not being removed from the textfield the previous data in the textfield is being present.
  the code i have tried with are</p>
  
  <pre><code>    answerTextField.text = @"";
      answerTextField.text = nil;
  </code></pre>
  
  <p>2) I am unable to delete the textfield data in which i am appending the data that is coming from the textfield.text </p>
  
  <pre><code>      -(void) keyPressed: (NSNotification*) notification { 
  if ([[[notification object]text] isEqualToString:@" "])
  {
      UITextField *textField = (UITextField *)[self.view viewWithTag:nextTag];
      textField.text = @"";
      [textField becomeFirstResponder];
      nextTag = textField.tag;
  }
  else
  {
      [[NSNotificationCenter defaultCenter] removeObserver: self name:UITextFieldTextDidChangeNotification object: nil];
  
      NSLog(@"TextField tag value :%d",tagCount);
      NSLog(@"TextField next tagg tag value :%d",nextTag);
  
      if (tagCount == nextTag+1) 
      {
          UITextField *textField = (UITextField *)[self.view viewWithTag:nextTag];
          [textField resignFirstResponder];
          NSLog(@"append string :%@",appendString);
      }
      else
      {
          NSLog(@"TextField nexttag value before :%d",nextTag);
  
          nextTag = nextTag + 1;
          NSLog(@"Letter is%@",[[notification object]text]);
  
          str= [[NSString alloc]initWithFormat:@"%@",[[notification object]text]];
          NSLog(@"TextField String :%@",str);
  
          NSLog(@"TextField nexttag value after :%d",nextTag);
  
          [appendString appendString:[NSString stringWithFormat:@"%@",str]];
          NSLog(@"Content in MutableString: %@",appendString);
      }
  
      NSLog(@"The tags in keypressed:%d",nextTag);
      UITextField *textField = (UITextField *)[self.view viewWithTag:nextTag];
      [textField becomeFirstResponder];
  }
  // For inserting Spaces taken from array.    
  if(tagCount+300 == nextTag)
  {
      for (int m=0  ; m&lt; [intArray count]; m++) 
      {
          [appendString insertString:@" " atIndex:[[intArray objectAtIndex:m]intValue]];
          NSLog(@"FinalString : %@",appendString);
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Edited: The textfield data that i am storing is being made nil, but the on the textfield the data is being remained it is not being removed, for the textfield i have added a background image, do not know whether it makes any difference or not, i am attaching the code for it: </p>
  
  <pre><code>    UIImageView *myView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"text_line.png"]];
                  myView.center = CGPointMake(5, 27);                     
                  [letterField insertSubview:myView atIndex:0];// mgViewTitleBackGround is image
                  [myView release];
  </code></pre>