新手问题在这里 -
我在视图控制器 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"];
}
我尝试从子类中调用它。h子类:
@interface SetNotificationClass : UIView < SwitchViewProtocol> {
habitsViewController *hvc;
}
@property (nonatomic, retain) habitsViewController *hvc;
子类 m:
@synthesize hvc;
- (IBAction)saveNotificationClick:(id)sender {
// [self scheduleAlarm];
[hvc backToHP:nil];
}
我收到“找不到方法”错误。任何的想法?
谢谢