Class1.m
#import Class2.h
Class2* test = [[Class2 alloc] init];
UIButton* button1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[dropButton addTarget:test action:@selector(actionPressed:) forControlEvents:UIControlEventTouchDown];
Class2.m
#import Class1.h
-(UIButton *)actionPressed:(UIButton *)buttonPressed{
NSLog(@"Test");
return buttonPressed;
}
The response function does not work and I am not sure why. App crashing during simulation. Advise on a fix would be greatly appreciated.