how to implement 2 tableViews in a class

  • Hi,

    I have two NSTableView outlets in my AppController class.

    So how do I implement delegate methods. I mean there syntax is same, so how
    won't it give rise to some sort of conflict?



    Also how can I distinguish which notification is sent by which tableView?



    Regards,

    Navneet
  • On Jan 5, 2008, at 12:01 PM, Navneet Kumar wrote:

    > I have two NSTableView outlets in my AppController class.
    > So how do I implement delegate methods. I mean there syntax is same,
    > so how
    > won't it give rise to some sort of conflict?
    >
    <http://developer.apple.com/documentation/Cocoa/Conceptual/TableView/Tasks/U
    singTableDataSource.html
    >

    > Also how can I distinguish which notification is sent by which
    > tableView?
    >
    Similar to above.

    mmalc
  • On Jan 5, 2008, at 12:01 PM, Navneet Kumar wrote:

    > I have two NSTableView outlets in my AppController class.
    >
    > So how do I implement delegate methods. I mean there syntax is same,
    > so how
    > won't it give rise to some sort of conflict?
    >
    > Also how can I distinguish which notification is sent by which
    > tableView?

    You'll notice that all data source and delegate methods pass the table
    view as a method argument. Any notifications sent by the table view
    also has the table view as the notification object.

    j o a r
  • Of course, other options are:

    *Split your code up into 2 controllers; one per table.
    *Use bindings instead.

    Mike.

    On 5 Jan 2008, at 20:25, j o a r wrote:

    >
    > On Jan 5, 2008, at 12:01 PM, Navneet Kumar wrote:
    >
    >> I have two NSTableView outlets in my AppController class.
    >>
    >> So how do I implement delegate methods. I mean there syntax is
    >> same, so how
    >> won't it give rise to some sort of conflict?
    >>
    >> Also how can I distinguish which notification is sent by which
    >> tableView?
    >
    >
    > You'll notice that all data source and delegate methods pass the
    > table view as a method argument. Any notifications sent by the table
    > view also has the table view as the notification object.
    >
    > j o a r
previous month january 2008 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