Good morning. I have 2 classes. One is inherited from UITableViewCell, the second from UIViewController (c).
In the first class there is a method that changes the image of the button when pressed (the button itself is in a cell).
-(void)method:(int)sender { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; UIImage *checkSel = [UIImage imageNamed:@"checked.png"]; if (sender == 0) { [self.checkButton setBackgroundImage:checkSel forState:UIControlStateNormal]; [defaults setBool:YES forKey:@"checkReq0"]; checkReq0 = YES; self.checkLabel.textColor = [UIColor greenColor]; NSLog(@"CheckOn1 OK"); } In the second class, I try to call this method, which should change the image on the same button when I click on another button (it is outside the cell)
-(IBAction)secondButton:(id)sender { firstClass *object = [[firstClass alloc] init]; [object method]; } The method itself works as a whole, tested using NSLog, but does not perform the task in any way. In the headers, too, everything seems to be spelled out as it should. I hope for your help, thanks
cellForRowAtIndexPathand call your method in this instance - Andrey Iskamov