I have been studying delegate.
so i write code that delegate then run this code.
Can you tell me what's the problem?
this is my code.
ViewController2.h
@protocol ViewController2Delegate <NSObject>;
@required
-(void)practiceDelegateMethod:(Float32)var1 andVar2:(Float32)var2;
@end
@interface ViewController2 : UIViewController
@property (assign, nonatomic) id <CompressSetupViewControllerDelegate> delegate;
ViewController2.m
@synthesize delegate;
- (IBAction)compressSetupCancleAction:(id)sender {
[self.delegate practiceDelegateMethod:var1 andVar2:var2];
[self dismissViewControllerAnimated:YES completion:nil];
}
ViewController1.h
@interface HomeViewController : UIViewController< ViewController2Delegate >
ViewController1.m
-(void) practiceDelegateMethod:(Float32)var1 andVar2:(Float32)var2{
NSLog(@"delegate var1 : %@ var2 : %@",[NSString stringWithFormat:@"%f",var1],[NSString stringWithFormat:@"%f",var2]);
}