I have been stuck at this problem for awhile now. I have a UIVIEW(SelectionScreen) that has been pushed in by using
SelectionScreen *aSelectionScreenViewController =[[SelectionScreen alloc]initWithNibName:@"SelectionScreen" bundle:nil];
self.navigationController pushViewController:aSelectionScreenViewController animated:YES]
[aSelectionScreenViewController release];
That works fine. But now the problem comes with this class. This class actually holds another Class called SelectionScreenTable. So the Architecture would be like this SelectionScreen -SelectionScreenTable
So now in the didSelectRow method of the SelectionScreenTable.m file i tried pushing another Class(class is called Graph.h) but its not working, the code i use is exactly the same as the above.
So i tried pushing Graph at the very beginning of the mainFlow of the app, just to see if my code is working or wrong, and yes, its working.
So i was wondering , how can i solve this? Detecting the superclass and then push the view into the superview? IM A OBJ-C newb though, code开发者_开发百科s and examples would be nice. Any Idea guys? thanks for reading btw
i solved it by using a transition animation instead . .
GraphView *viewController =[[GraphView alloc]initWithNibName:@"GraphView" bundle:nil];
viewController.view.transform = CGAffineTransformMakeRotation(-3.14 *(0)/180.0);
viewController.view.bounds = CGRectMake(0,0,1025,769);
viewController.view.center = CGPointMake(512.5, 374.5);
UIView *theCurrentView = self.view;
UIView *theWindow = [theCurrentView superview];
[theCurrentView removeFromSuperview];
[theWindow addSubview:viewController.view];
CATransition *animation = [CATransition animation];
[animation setDuration:0.35];
[animation setType: kCATransitionPush];
[animation setSubtype:kCATransitionFromTop];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]];
[[theWindow layer] addAnimation:animation forKey:@"SwitchToGraphView"];
[viewController release];
精彩评论