title: setting a delegate for a custom view inside a uitableview cell
body: <p>I am not sure if that's possible.</p>
  
  <p>So I have a custom cell - which inside contains a custom uiview. This UIView is a view that displays bar diagrams. So I want to set the dataSource, and the delegate for that UIView.</p>
  
  <p>If I use that code :</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
  
      static NSString *simpleTableIdentifier = @"StatsCell";
  
      StatsTableViewCell  *cell = (StatsTableViewCell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
      if (cell == nil)
      {
          NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"StatsTableViewCell" owner:self options:nil];
          cell = [nib objectAtIndex:0];
      }
  
  
  
      cell.barChart.dataSource = self ;
      dell.barChart.delegate = self;
  }
  </code></pre>
  
  <p>I get a warning :</p>
  
  <pre><code> Assigning to 'id&lt;JBBarChartViewDelegate&gt;' from incompatible type 'StatsViewController *const __strong'
  </code></pre>
  
  <p>How do I do that? And then, if that's possible - since that delegate method will be called for any of the cells - how do I distinguish for which of them is called?</p>
  
  <p>I am using JBChartView from <a href="https://www.cocoacontrols.com/controls/jbchartview" rel="nofollow">here</a>.</p>
  
  <p>Thanks.</p>