I want to change the value being displayed in a NSTableView Cell while editing it. My requirement is the following: Initially I entered a cell value of 234.5678978 and after editing the value is being rounded up to 0 decimal precision(that means 235). My requirement is that when I could click that cell, it should show me value unto certain decimal precision say up 5 precision, in this case 234.56790). How can I achieve this functionality. I tried to capture the action of double click editing the cell of NSTableView:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(editingDidEnd:)
name:NSControlTextDidEndEditingNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(editingDidBegin:)
name:NSControlTextDidBeginEditingNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(editingDidChange:)
name:NSControlTextDidChangeNotification object:nil];
- (void)editingDidEnd:(NSNotification *)notification
{
NSLog(@"text editing fisnished");
}
- (void)editingDidBegin:(NSNotification *)notification
{
NSLog(@"text is being edited");
}
- (void)editingDidChange:(NSNotification *)notification
{
NSLog(@"text was being changed");
}
But only editingDidEnd
was called on tab out and the other two methods were never called.