Problem with tableViewSelectionDidChange

  • Hey Guys,

    As the subject states - I'm having a problem with
    tableViewSelectionDidChange

    The problem being that the event doesn't fire. I have the below event
    in a subclass of NSTableView. I've added another event (keyUp) to
    test to be sure the subclass was working and it worked.

    - (void)tableViewSelectionDidChange:(NSNotification *)aNotification
    {
        NSLog(@"FIRED!!");

        NSTableView *tv = [aNotification object];
        [tv editColumn: 0
            row:[tv selectedRow]
            withEvent: nil
            select: YES];
    }

    If it matters I am using CoreData and I have an entity tied to the
    NSTableView.

    Any help would be great - I've been stuck on this simple thing for
    hours.

    Maybe a setting in IB that I am missing?

    Cheers,
    Jerry
    www.embraceware.com
  • On Oct 1, 2005, at 7:14 PM, Jerry Brace wrote:
    > The problem being that the event doesn't fire. I have the below
    > event in a subclass of NSTableView. I've added another event
    > (keyUp) to test to be sure the subclass was working and it worked.
    >
    > - (void)tableViewSelectionDidChange:(NSNotification *)aNotification
    > {
    > NSLog(@"FIRED!!");
    >
    > NSTableView *tv = [aNotification object];
    > [tv editColumn: 0
    > row:[tv selectedRow]
    > withEvent: nil
    > select: YES];
    > }

    -tableViewSelectionDidChange: is a delegate method, so you need to
    connect the table's delegate outlet to an object that implements this
    method.  Try making the table view its own delegate (might be tricky
    in IB -- I haven't connected an object to itself recently, so I don't
    remember offhand).  Typically, though, one implements a delegate
    method in a separate controller class, not a subclass of the view class.

    --Andy
previous month october 2005 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Go to today