Newbee question here –
I have this method in the view controller m:
-(void) backToHP:(id<SwitchViewProtocol>) fromView{
[(UIView *)self.currentView removeFromSuperview];
[self.currentView clearView];
[self.view addSubview:_hpView];
self.currentView = nil;
CATransition *animation = [CATransition animation];
[animation setDuration:0.2];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromLeft];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[[self.view layer] addAnimation:animation forKey:@"SwitchToView1"];
}
I try to invoke it from a subclass.
subclass h:
@interface SetNotificationClass : UIView < SwitchViewProtocol> {
habitsViewController *hvc;
}
@property (nonatomic, retain) habitsViewController *hvc;
subclass m:
@synthesize hvc;
- (IBAction)saveNotificationClick:(id)sender {
// [self scheduleAlarm];
[hvc backToHP:nil];
}
I get the “method not found” error. any idea?
Thanks
Where do you initialize hvc? You’re not sending backToHP: to nil, right? I’d also probably just set the view controller as the delegate of the view, rather than creating a new property.