Show super.view - iPhone
I've created ViewControllers ABC and XYZ. XYZ inherits from ABC. In the AppDelegate, I add XYZ.view as subView.
Now at the click of a button in XYZ I want to display ABC.view on a small portion of screen. I've tried some combinations of the following but nothing works.
- [self.view bringSubviewToFront:super.view];
- 开发者_JS百科[appDelegate.window bringSubviewToFront:super.view];
- [self.view addSubview:super.view];
- [appDelegate.window insertSubview:self.view atIndex:0];
- [appDelegate.window insertSubview:super.view aboveSubview:self.view];
- [super.view setNeedsDisplayInRect:CGRectMake(0, 0, 320, 320)];
Super is a keyword that Is used only to invoke the superclass's implementation of a particular method. It does not refer to an actual instance of a class. If you want to create and display a viewcontroller, you have to alloc and init an instance of it, then present it just as you have done with XYZ.
精彩评论