• 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: NSTableView receiving selection events (newbie)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView receiving selection events (newbie)


  • Subject: Re: NSTableView receiving selection events (newbie)
  • From: Ferhat Ayaz <email@hidden>
  • Date: Tue, 26 Dec 2006 13:23:37 +0100

Hello ,

I have still problems to receive notifications. This is my controller methode

- (void)awakeFromNib
{

	[[NSNotificationCenter defaultCenter] addObserver:self
				selector:@selector(selectionChanged:)
				name:NSTableViewSelectionDidChangeNotification object:nil];
}

And this is my selector in the same class

- (void) selectionChanged: (NSNotification *) notification
{
    int row;
    row = [projectFoldersTableView selectedRow];

    if (row == -1) {
		printf("Ok changed\n");
    } else {
		printf("No row\n");
    }

} // tableViewSelectionDidChange

I should receive the notification for all tableviews but I'm receiving nothing.
Do you have any idea?


Thanks,
Ferhat


On Dec 26, 2006, at 12:29 PM, Wain Glaister wrote:

Hi,

It sounds like you probably need to review:

Using a table view and delegate:
http://developer.apple.com/documentation/Cocoa/Conceptual/TableView/ TableView.html#//apple_ref/doc/uid/10000026
http://developer.apple.com/documentation/Cocoa/Conceptual/TableView/ Tasks/UsingTableDelegate.html


Using the notification mechanism:
http://developer.apple.com/documentation/Cocoa/Conceptual/ Notifications/Introduction/introNotifications.html#//apple_ref/doc/ uid/10000043


Additionally you might want to take a close look at all of the table view delegate methods as tableViewSelectionDidChange is not the only option and may no be the best depending on what you are trying to achieve...

Hope this helps,

Wain

On 26 Dec 2006, at 11:13, Ferhat Ayaz wrote:

Hello,

I have another newbie question. Sorry but I didn't found a document describing this problem:
To receive selection notification from a TableView you have to implement this method:


- (void) tableViewSelectionDidChange: (NSNotification *) notification
{
}

But in which class should I implement this and how can I register it to receive the selection event?

I have a controller (derived from NSObject) with an outlet "tableView". I have connected it with my NSTableView.

Thanks,
Ferhat

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
40googlemail.com


This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSTableView receiving selection events (newbie)
      • From: James Bucanek <email@hidden>
References: 
 >NSTableView receiving selection events (newbie) (From: Ferhat Ayaz <email@hidden>)
 >Re: NSTableView receiving selection events (newbie) (From: Wain Glaister <email@hidden>)

  • Prev by Date: Re: NSTableView receiving selection events (newbie)
  • Next by Date: (no subject)
  • Previous by thread: Re: NSTableView receiving selection events (newbie)
  • Next by thread: Re: NSTableView receiving selection events (newbie)
  • Index(es):
    • Date
    • Thread