Question

I have to populate the nstableview with values from data base based on the date and time which i select from the date picker. When i select a date and time from the 'To date' date picker, the table has to be populated with values. For this i have used notification. In void awake from nib,

     NSNotificationCenter *center = [[NSNotificationCenter alloc] init];
    [center addObserver:self selector:@selector(controlTextDidChange:) name:NSControlTextDidChangeNotification object:_toDate]; //_toDate is an ivar 

and,

  -(void)controlTextDidChange:(NSNotification *)obj
  { //populating tableview with datas }

and i have connected the date picker cell's delegate to file owner. The problem is it is not at all going into the controlTextDidChange: method. Pls help me to populate the nstableview once if i select the date and time from the date picker. Thanks.

Was it helpful?

Solution

You need to post your notification like this :

[[NSNotificationCenter defaultCenter] postNotificationName:NSControlTextDidChangeNotification object:_toDate];

write this code in you pickers selection methode it will work for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top