我是编程新手,我整晚都在寻找,很长时间以来都想弄清楚这一点。不能......我不想使用导航控制器,但我想做的是这个。
所以我的项目中有两个课程。1 类和 2 类。现在 Class1 中有一个按钮。如果按下此按钮,我希望屏幕转到 Class2。我得到的最接近的是创建一个父类,但是当我这样做时,按钮仍然在两个类上。
- (IBAction)addScheduleB:(id)sender {
[UIView beginAnimations:@"View Curl" context:nil];
[UIView setAnimationDuration:1.00];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
if (self.firstScreen.view.superview ==nil){
if(self.firstScreen==nil) {
self.firstScreen = [[FirstScreen alloc] initWithNibName:@"FirstScreen" bundle:nil];
}
[self.config1.view removeFromSuperview];
[self.view insertSubview:self.firstScreen.view atIndex:0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view cache:YES];
[self.config1.view removeFromSuperview];
[self.view insertSubview:self.firstScreen.view atIndex:0];
[sender setTitle:@"Switch To DVR"];
}
else{
if(self.config1 == nil){
self.config1 = [[Config1 alloc] initWithNibName:@"Config1" bundle:nil];
}
[self.firstScreen.view removeFromSuperview];
[self.view insertSubview:self.config1.view atIndex:0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES];
[self.firstScreen.view removeFromSuperview];
[self.view insertSubview:self.config1.view atIndex:0];
[sender setTitle:@"Switch To TV"];
}
[UIView commitAnimations];
}
我想删除父类并只有两个类。
按下时是否可以在class1内有一个按钮将我带到class2???