• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Multiple TableViews... same Controller?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple TableViews... same Controller?


  • Subject: Re: Multiple TableViews... same Controller?
  • From: Janakiram Palepu <email@hidden>
  • Date: Mon, 6 Nov 2006 14:24:08 +0530

Hi,

Every object passes itself as one of the argument to its delegate method , so that the delegate( Controller ) will know which object notifies it.

	Example :

	- (int)numberOfRowsInTableView:(NSTableView *)aTableView {

			if ( aTableView == TableInTab1 ) {



				return records1Count;



			} else if ( aTableView == TableInTab2 ) {



				return records2Count;



			}

			return 0;

	}

There is no need to create a separate controller for each tableview, its all depends on your application logic.

Let me know if you still have any problem.

Thanks,
JanakiRam.

On 06-Nov-06, at 1:27 PM, Mark Manes wrote:

I have an application where I have two tables. One is in one tab and the other table is in another tab. They actually will show the same data (but that is not really all that important).

I would like to know if I can tell when I get the following methods--how do I tell what table it is?

- numberOfRowsInTableView
- objectValueForTableColumn
- tableViewSelectionDidChange

Do I really need to create a controller class for every table I create?

What if I really do care that the table is exactly the same? I just want the application to act differently based on what tab the user is in--so I need to know what tab view I am in -or- I need to know which table item was selected.

I'd appreciate your wisdom as always..

-mark=

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Multiple TableViews... same Controller? (From: Mark Manes <email@hidden>)

  • Prev by Date: Re: Multiple TableViews... same Controller?
  • Next by Date: Re: ip addresses and countries
  • Previous by thread: Re: Multiple TableViews... same Controller?
  • Next by thread: Re: Multiple TableViews... same Controller?
  • Index(es):
    • Date
    • Thread