title: ScatterPlot with gap -[NSNull doubleValue]: unrecognized selector sent to instance
body: <p>I've been trying to create a gap in my scatterPlot using this suggestion:
  <a href="https://stackoverflow.com/questions/17333532/ios-scatter-core-plot-with-a-gap">iOS Scatter core plot with a gap</a>        </p>
  
  <p>I wanted to draw 2 vertical lines by creating the data:</p>
  
  <pre><code>NSMutableArray&lt;NSDictionary *&gt; *contentArray = [[NSMutableArray alloc] init];
  
          [contentArray addObject:@{ @"x": _startPointValue, @"y": _startValue }];
          [contentArray addObject:@{ @"x": _startPointValue, @"y": @5 }];
  
          //add null points not to link the 2 lines
          [contentArray addObject:@{ @"x": _endPointValue, @"y": [NSNull null] }];
          [contentArray addObject:@{ @"x": _endPointValue, @"y": _endValue }];
          [contentArray addObject:@{ @"x": _endPointValue, @"y": @5 }];
  
          _verticalLinesData = contentArray;
  </code></pre>
  
  <p>but I receive error:</p>
  
  <pre><code>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull doubleValue]: unrecognized selector sent to instance 0x1a0f0e490'
  </code></pre>
  
  <p>When I comment out the line with [NSNull null], the lines are drawn properly (but connected).</p>
  
  <p>What could be the reason. I don't use the _verticalLinesData elsewhere (only in coreplot's datasource methods).</p>
  
  <p>EDIT:
  my datasource methods:</p>
  
  <pre><code>-(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot {
  if ( [plot.identifier isEqual:VERTICALLINESPLOTID] ) {
          return _verticalLinesData.count;
      }
      else {
          return 0;
      }
  }
  
  -(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index {
      NSString *key = (fieldEnum == CPTScatterPlotFieldX ? @"x" : @"y");
      NSNumber *num = [[NSNumber alloc] init];
     if ([plot.identifier isEqual:VERTICALLINESPLOTID] ) {
          num = _verticalLinesData[index][key];
          num = @([num doubleValue]);
      }
      else {
          num = 0;
      }
      return num;
  }
  </code></pre>