title: AnyObject To CGPoint
body: <p>I cant seem to figure this out, I have a Objective-C function that returns an NSArray, I know for sure that data inside the NSArray contains CGPoint objects How in the world do I cast this to an Array </p>
  
  <p>Here is the function </p>
  
  <pre><code>+(NSArray *)translatePoints:(NSArray *)points fromView:(UIView *)fromView toView:(UIView *)toView
  {
      NSMutableArray *translatedPoints = [NSMutableArray new];
  
      // The points are provided in a dictionary with keys X and Y
      for (NSDictionary *point in points) {
          // Let's turn them into CGPoints
          CGPoint pointValue = CGPointMake([point[@"X"] floatValue], [point[@"Y"] floatValue]);
          // Now translate from one view to the other
          CGPoint translatedPoint = [fromView convertPoint:pointValue toView:toView];
          // Box them up and add to the array
          [translatedPoints addObject:[NSValue valueWithCGPoint:translatedPoint]];
      }
  
      return [translatedPoints copy];
  }
  </code></pre>