1

I taking reference from url link text

I am able to bring the checkbox on tableview. Now on button click i want to check which checkbox is selected. HOw can i do so?

In the url "Amagrammer" suggested to use NSnotification, can any one provide me an tutorial for that.

    - (void) toggleImage
{
   selected = !selected;
   imageView.image = (selected ? selectedImage : normalImage); 

   // Use NSNotification or other method to notify data model about state change.
   // Notification example:
   NSDictionary *dict = [NSDictionary dictionaryWithObject: [NSNumber numberWithInt: self.tag forKey: @"CellCheckToggled"];
   [[NSNotificationCenter defaultCenter] postNotificationName: @"CellCheckToggled" object: self userInfo: dict];

}
Community
  • 1
  • 1
abhikpw
  • 11
  • 2

1 Answers1

0

In your view controller or somewhere you handle the data You add a observer

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(YOUR__FUNCTION) name:@"CellCheckToggled" object:nil];

Then you can do sth in YOUR__FUNCTION with your userInfo

-(void)YOUR__FUNCTION: (NSNotification*) aNotification
{
dict = [aNotification userInfo];

}
Horst
  • 1,733
  • 15
  • 20