• 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
NSSliderCell don't change my data.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSSliderCell don't change my data.


  • Subject: NSSliderCell don't change my data.
  • From: Jesper Hansen <email@hidden>
  • Date: Sat, 9 Jul 2005 20:12:03 +0200

I have used most of my day trying to get a NSSliderCell in a NSTableView to work without success.

If I set it up in IB it works fine, but I would like to add and remove the columns programatically, so I figured this should work:

NSTableColumn *newColumn = [[NSTableColumn alloc] initWithIdentifier:@"test"];
[m_cacheTableView addTableColumn:newColumn];
[[newColumn headerCell] setStringValue:@"Test"];
[newColumn setEditable:YES];
[newColumn bind:@"value" toObject:m_cacheArrayController withKeyPath:@"arrangedObjects.difficulty" options:nil];
#if 1
NSSliderCell *newCell = [[[NSSliderCell alloc] init] autorelease];
[newColumn setDataCell:newCell];
[newCell setEditable:YES];
[newCell setMinValue:1.0];
[newCell setMaxValue:5.0];
[newCell setContinuous:YES];
#else
NSTextFieldCell *newCell = [[[NSTextFieldCell alloc] init] autorelease];
[newColumn setDataCell:newCell];
[newCell setEditable:YES];
[newCell setFormatter:[[[NSNumberFormatter alloc] init] autorelease]];
#endif


m_cacheTableView is a pointer to a NSTableView.
m_cacheArrayController is a NSArrayController that is bound to some CoreData objects.
"arrangedObjects.difficulty" is float values.


The Slider cell is correctly displaying the "difficulty " values, but when I move the slider with the mouse it just jumps back to the starting position when I release the mouse button.

If I instead use a TextField cell I can successfully edit the data.
I have tried to set miscellaneous options in the bind call, but nothing seemed to help.



All my googling just turned up examples on how to use NSTableDataSource's tableView:setObjectValue:forTableColumn:row: which I assume is unused then using bindings.


--
Jesper Hansen

_______________________________________________
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


  • Prev by Date: Re: Importance of thread safety and performance.
  • Next by Date: Re: Importance of thread safety and performance.
  • Previous by thread: Re: Finding header files
  • Next by thread: Adding internet passwords to the keychain
  • Index(es):
    • Date
    • Thread