title: Retrieving object from NSMutableArray
body: <p>I have a NSMutableArray and I would like to use data from it in another view. I read up and found we can use indexOfObject to read data, but my NSMutableArray has multiple values, and I do not know how to obtain a particular field from the NSMutableArray. </p>
  
  <p>Any help would be great appreciated.</p>
  
  <p>I'm currently stuck at my IBAction onStartPressed. at the line </p>
  
  <pre><code>    self.clueHint.text = ds[0].initialClue;
  //or
      self.clueHint.text = ds objectAtIndex:0 initialClue;
  </code></pre>
  
  <p>I displayed my other file and code which is involved. </p>
  
  <p>ClueData.h
      #import </p>
  
  <pre><code>@interface ClueData : NSObject
  @property(nonatomic, strong) NSString * clueName;
  @property(nonatomic, strong) NSString * initialClue;
  @property(nonatomic, strong) NSString * clueHint1;
  @property(nonatomic, strong) NSString * clueHint2;
  
  @property(nonatomic, strong) NSString * clueAnswer;
  @property(nonatomic, strong) UIImage * clueImage;
  @end
  </code></pre>
  
  <p>ClueDataDAO.h</p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  #import "ClueData.h"
  @interface ClueDataDAO : NSObject
  @property(strong, nonatomic) NSMutableArray * clueDataArray;
  
  -(NSMutableArray *) PopulateDataSource;
  @end
  </code></pre>
  
  <p>ClueDataDAO.m</p>
  
  <pre><code>#import "ClueDataDAO.h"
  
  @implementation ClueDataDAO
  @synthesize clueDataArray;
  -(NSMutableArray *) PopulateDataSource
  {
      clueDataArray = [[NSMutableArray alloc]init];
       ClueData * sampleData = [[ClueData alloc]init];
  
      sampleData.clueName = @"Tropical Fruit Tree";
      sampleData.initialClue = @"Where all the Tropical trees are planted.";
      sampleData.clueHint1 = @"It is located at Area 10";
      sampleData.clueHint2 = @"It could be found near Eco Lake";
      sampleData.clueAnswer = @"Fruit tree collection";
      NSString * file=[[NSBundle mainBundle]pathForResource:@"FruitTreeCollection" ofType:@"jpg"];
      sampleData.clueImage = [UIImage imageWithContentsOfFile:file];
      [clueDataArray addObject:sampleData];
      sampleData=nil;
  
      return clueDataArray;
  }
  @end
  </code></pre>
  
  <p>GamePageViewController.M</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
      daoDS = [[ClueDataDAO alloc]init];
      self.ds = daoDS.PopulateDataSource; //load pre-build NSMutableArray
      self.answer.delegate = self;
      // Do any additional setup after loading the view.
  }
  
  - (IBAction)onStartPressed:(id)sender {
  
      //initiate load object
  // stuck at here :(
  
      ClueData * currentClue = [ds objectAtIndex:0]; // app got terminate at this line of code
  self.clueHint.text = [currentClue initialClue];
  
  
  }
  </code></pre>