• 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: tableViewSelectionDidChange does not fire on deselect
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tableViewSelectionDidChange does not fire on deselect


  • Subject: Re: tableViewSelectionDidChange does not fire on deselect
  • From: Ronald Hofmann <email@hidden>
  • Date: Tue, 01 Apr 2014 15:43:40 +0200

I found what was wrong, mea culpa :(

At the very beginning I have some lines to to take over if row == -1 and that intercepted.
It works like this:

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

	NSInteger row = [_tableView selectedRow];

	if (row == -1)	{ //Code if deselected
		NSLog(@"Deselected: %li",row); //returns always -1
		return;
	}

	else	{ //Code if selected
		NSLog(@"Select row %li:  %@",row ,thePathToFile);//returns row number
	}
}

Greetings from Switzerland, Ronald Hofmann
---

Am 01.04.2014 um 15:25 schrieb Michael Starke <email@hidden>:

> I can report the same error in my own project. It's a view based table view, single selection not firing on deselect.
>
> The table view bound is bound to an NSArrayController for data.
>
>
> On 01 Apr 2014, at 15:11, Keary Suska <email@hidden> wrote:
>
>> On Mar 31, 2014, at 11:51 PM, Ronald Hofmann wrote:
>>
>>> I´m using tableViewSelectionDidChange to find out which row of myTableView was clicked.
>>> Works fine so far. I´m taking some action than.
>>>
>>> - (void)tableViewSelectionDidChange:(NSNotification *)notification
>>> {
>>> 	NSInteger row = [_tableView selectedRow];
>>> 	NSLog(@„Row: %il", row);
>>>
>>> }
>>>
>>> The problem is that this method is not called when I deselect a row using cmd-click on a row.
>>
>> This should not be the case. The notification should be posted any time the selection changes for any reason. Can you replicate this behavior in a test project that you can post?
>>
>> Best,
>>
>> Keary Suska
>> Esoteritech, Inc.
>> "Demystifying technology for your home or business"
>>
>>
>> _______________________________________________
>>
>> Cocoa-dev mailing list (email@hidden)
>>
>> 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:
>>
>> This email sent to email@hidden
>
>
> ___m i c h a e l   s t a r k e____
>       geschäftsführer
>       HicknHack Software GmbH
>       www.hicknhack-software.com
>
> ___k o n t a k t____
>       +49 (170) 3686136
>       email@hidden
>
> ___H i c k n H a c k   S o f t w a r e   G m b H____
>       geschäftsführer - maik lathan | andreas reischuck | michael starke
>       bayreuther straße 32
>       01187 dresden
>       amtsgericht dresden HRB 30351
>       sitz - dresden
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> 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:
>
> This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden


References: 
 >Re: tableViewSelectionDidChange does not fire on deselect (From: Keary Suska <email@hidden>)
 >Re: tableViewSelectionDidChange does not fire on deselect (From: Michael Starke <email@hidden>)

  • Prev by Date: Re: tableViewSelectionDidChange does not fire on deselect
  • Next by Date: Re: NSDictionary @synchronize to read multiple objects
  • Previous by thread: Re: tableViewSelectionDidChange does not fire on deselect
  • Next by thread: Re: NSDictionary @synchronize to read multiple objects
  • Index(es):
    • Date
    • Thread