Here's what it _sounds_ like you're trying to do. Let me know if I've misunderstood:

 * You have multiple table views.
 * The data source logic for all of them is essentially the same.
* You are trying to have one _instance_ of your data source class be the data source for all of your tables. * You want some way for the data source methods to tell which table view they are dealing with. * Specifically, you want to be able to get some kind of name that you can assign to the table view.

Here are my comments:

* You _could_ use the autosave name if in fact you want your tables to autosave. Autosaving means that certain attributes of your table view will be saved when your application quits and restored when you relaunch. I'm not exactly sure offhand how autosaving works, and I must say I could not dig up this information by searching the Xcode documentation. One problem is that "autosave" is sometimes spelled "auto save"; another problem is that "autosave" also seems to refer to automatic saving of _documents_.

* Another option is to subclass NSTableView and add your own "name" attribute. You'd have to have some code somewhere that sets this attribute. Then [tableView name] would work. I'm not sure why you thought it might work otherwise; there's no -name method in the docs for NSTableView or any of its superclasses. (Actually I would call it something more specific than "name", to avoid the possibility of name collision in case Apple decides to add a "name" to NSTableView.)

* Another option is to add a "name" attribute to your data source class, and create a separate data source instance for each table view. The cost of this is trivial unless there would be a lot of redundancy among the data source instances (and I mean a lot). It's very likely you wouldn't be saving a meaningful amount of space by using just one shared data source instance.

* I think it would help if you tell us what kind of information these table views contain, and how the data source works. This seems to be partly a design question and not just about whether NSTableView has some method or other.

--Andy


On Apr 2, 2008, at 5:17 PM, Mr. Gecko wrote:

How would I get the name of a table view? I am trying to make all of my tables use one class for the data source so I can make my code more smaller. I know I can use autosave name but I am not sure if I am suppose to use that or what it does.
Here is what I have tried already
[tableView name];
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/aglee%40mac.com

This email sent to [EMAIL PROTECTED]

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to