title: print reverse of a string
body: <p>I am writing a program which prints the reverse of a string in a textfield, taking input text from the other textfield.  When I press enter after entering text into one textfield the result(reverse) should be dispalyed in the other text field.</p>
  
  <p>I have tried like this, but am getting weird results.</p>
  
  <p>.h file:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  
  @interface reverseVC : UIViewController {
  
      UITextField *textEntered;
      UITextField *textDisplay;
  
  }
  @property (nonatomic,retain) IBOutlet UITextField *textDisplay;
  @property (nonatomic,retain) IBOutlet UITextField *textEntered;
  
  - (NSMutableArray*) stringReverse;
  - (IBAction) enter;
  
  @end
  </code></pre>
  
  <p>.m file</p>
  
  <pre><code>- (NSMutableArray *) stringReverse
  {
  
      NSString *value = textEntered.text;
      NSArray *tempArray = [[[NSArray alloc] initWithObjects:value,nil] autorelease];
  
      NSMutableArray *arr = [[[NSMutableArray alloc] init] autorelease];
  
  
      for (int i=[tempArray count]-1; i&gt;=0; i--)
      {
          [arr addObject:[tempArray objectAtIndex:i]];
          NSLog(@"the object is:%c",arr);
      }
  
      return arr;
  }
  -(IBAction)enter
  {
     textDisplay.text = [NSString stringWithFormat:@"%c",[self stringReverse]];
  }
  </code></pre>
  
  <p>Earlier got warnings like SIG_ABT and EXE_BAD_ACCESS before placing nil and autorelease in array initialisations. Now the warnings are solved but results undesiredly.</p>
  
  <p>Where am I going wrong?</p>