Tom's Cocoa Blog

Rantings of a cocoa nut

Deselect index of Selection of NSArrayController

Posted by tom on October 11, 2014
Posted in: Uncategorized.

The following code will deselect the index of an NSArrayController leaving the controller without a selected index. This works well when observing key value “selectedIndex” of NSArrayController when the user is selecting in two different arrays and a reset of the indexes is required to get an observation notice.

-(IBAction)resetArraySelection:(id)sender
{
NSIndexSet *indexEmptySet= [NSIndexSet indexSet];
NSLog(@”manual switching”);
if (manual) {

//NSArrayController 1
[boxList setSelectionIndexes: indexEmptySet];

}else{
//NSArrayController 2

[DeviceArrayController setSelectionIndexes: indexEmptySet];

}
}

Print Friendly

Posts navigation

← Cocoa AsynchSocket notice when remote server disconnects
  • Recent Posts

    • Deselect index of Selection of NSArrayController
    • Cocoa AsynchSocket notice when remote server disconnects
    • Brother HL-3040CN Reset Toner
    • Unhide User/Library folder in Lion
    • Adding Templetes to iWork Pages
  • Recent Comments

    • Julian Blow on Brother HL-4040cn Toner Life End
    • Dan Urbach on Brother HL-4040cn Toner Life End
    • kirsten on Brother HL-4040cn Toner Life End
    • Danni on Samsung LN52A750 DLNA Wiselinkpro -Sorting it Out
    • Bilbo on Brother HL-4040cn Toner Life End
  • Archives

    • October 2014
    • August 2011
    • July 2011
    • June 2011
    • May 2011
    • January 2011
    • December 2010
    • November 2010
    • September 2010
    • April 2010
    • August 2009
    • July 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009
    • November 2008
    • October 2008
    • February 2008
  • Categories

    • Uncategorized
  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
Proudly powered by WordPress Theme: Parament by Automattic.