title: OBJ-C: Getting the minimum/maximum value in a NSMutableArray
body: <p>I want to get the maximum and minimum values of a NSMutableArray so I can create a core-plot plotspace and graph based around those max and min values.</p>
  
  <p>My code is as follows:</p>
  
  <pre><code>NSMutableArray *contentArray = [NSMutableArray arrayWithCapacity:100];
  NSUInteger i;
  for (i=0; i&lt;60; i++){
  id x = [NSNumber numberWithFloat:i*0.05];
  id y = [NSNumber numberWithFloat:1.2*rand()/(float)RAND_Max + 0.6];
  [contentArray addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:x, @"x", y, @"y", nil]];
  }
  
  self.dataForPlot = contentArray;
  
  CPXYPlotSpace *plotSpace = (CPXYPlotSpace *)graph.defaultPlotSpace;
  plotSpace.xRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromFloat() length:CPDecimalFromFloat()];
  plotSpace.yRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromFloat() length:CPDecimalFromFloat()];
  </code></pre>
  
  <p>What do I fill in the blanks for xRange and yRange assignment if I want the graph to span only the space of what's specified in contentArray?</p>