title: NSTextField not calling delegate when inside an NSTableCellView
body: <p>I have a fairly vanilla Source List (dragged out from the Object Library) in my app, with an <code>NSTreeController</code> as its data source. I set the <code>NSTextField</code> inside the <strong>DataCell</strong> to be editable, but I want to be able to turn that off for some cells. The way I figured you would do this, is with a delegate for the <code>NSTextField</code>, but none of the delegate methods I've tried get called. Is there something I'm missing? I have the delegate set with an outlet in my XIB, and it happens to be the delegate to the owner <code>NSOutlineView</code>, as well, implementing both the <code>NSOutlineViewDelegate</code> and  <code>NSTextFieldDelegate</code> protocols.</p>
  
  <p>Also, I can't use the old <code>–outlineView:shouldEditTableColumn:item:</code> <code>NSOutlineViewDelegate</code> method either, since that only works with cell-based Outline Views (<em>I'm assuming this is the case - the Outline View documentation doesn't appear to have been updated for Lion, though the analogous <code>NSTableView</code> documentation has, and those methods don't get called either</em>).</p>
  
  <h2>Update</h2>
  
  <p>I reproduced this in a brand new test project, so it's definitely not related to any of my custom classes. Follow the steps below to create my sample project, and reproduce this problem.</p>
  
  <ol>
  <li>In Xcode 4.1, create a new project, of type Mac OS X Cocoa Application, with no special options selected</li>
  <li>Create two new files, <em>SourceListDataSource.m</em> and <em>SourceListDelegate.m</em>, with the contents specified below</li>
  <li>In MainMenu.xib, drag a <code>Source List</code> onto the Window</li>
  <li>Drag two <code>Object</code>s onto the dock (left side of the window), specifying the <code>SourceListDataSource</code> class for one, and the <code>SourceListDelegate</code> for the other</li>
  <li>Connect the Outline View's <code>dataSource</code> and <code>delegate</code> outlets to those two objects</li>
  <li>Select the Static Text <code>NSTextField</code> for the DataCell view inside the outline view's column</li>
  <li>Turn on its <code>Value</code> binding, keeping the default settings</li>
  <li>Connect its <code>delegate</code> outlet to the Source List Delegate object</li>
  <li>Set its <code>Behavior</code> property to Editable</li>
  <li>Build and Run, then click twice on either cell in the outline view.</li>
  </ol>
  
  <p><strong>Expected</strong>: The field is not editable, and there is a "well, should I?" message in the log</p>
  
  <p><strong>Actual</strong>: The field is editable, and no messages are logged</p>
  
  <p>Is this a bug in the framework, or am I supposed to achieve this a different way?</p>
  
  <hr>
  
  <h3>SourceListDataSource.m</h3>
  
  <pre><code>#import &lt;Cocoa/Cocoa.h&gt;
  
  @interface SourceListDataSource : NSObject &lt;NSOutlineViewDataSource&gt;
  
  @property (retain) NSArray *items;
  
  @end
  
  @implementation SourceListDataSource
  
  @synthesize items;
  
  - (id)init
  {
      self = [super init];
      if (self) {
          items = [[NSArray arrayWithObjects:@"Alo", @"Homora", nil] retain];
      }
  
      return self;
  }
  
  - (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item {
      if (!item) {
          return [self.items objectAtIndex:index];
      }
  
      return nil;
  }
  
  - (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item {
      return !item ? self.items.count : 0;
  }
  
  - (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item {
      return NO;
  }
  
  - (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item {
      return item;
  }
  
  @end
  </code></pre>
  
  <h3>SourceListDelegate.m</h3>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  
  @interface SourceListDelegate : NSObject &lt;NSOutlineViewDelegate, NSTextFieldDelegate&gt; @end
  
  @implementation SourceListDelegate
  
  - (NSTableRowView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTableColumn *)tableColumn item:(id)item {
      return [outlineView makeViewWithIdentifier:@"DataCell" owner:self];
  }
  
  - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor {
      NSLog(@"well, should I?");
      return NO;
  }
  
  @end
  </code></pre>