I have a view called BlueView that calls a modal view called DatePick. When DatePick is dismissed by pressing a button I would like it to call a method in BlueView. Heres what I have so far:
In BlueViewController.h;
In BlueViewController.m
In DatePickController.m
At this point I am getting an error in DatePickController.m saying that "delegate" is undeclared. Any thoughts would be appreciated. Also, if you think there are other things missing, please let me know.
In BlueViewController.h;
Code:
@protocol dateset
-(void)calculate;
@end
@interface BlueViewController : UIViewController <dateset> {
id <dateset> delegate;
(other code here)
@property(assign)id<dateset>delegate;
In BlueViewController.m
Code:
@synthesize delegate;
-(void)calculate {
(the method I would like to be called)
In DatePickController.m
Code:
- (IBAction) selectButtonPressed:(id)sender {
chooseDate = [datePicker date];
gotnewdate = 1;
[delegate calculate];