开发者

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.

  1. [self.view bringSubviewToFront:super.view];
  2. 开发者_JS百科[appDelegate.window bringSubviewToFront:super.view];
  3. [self.view addSubview:super.view];
  4. [appDelegate.window insertSubview:self.view atIndex:0];
  5. [appDelegate.window insertSubview:super.view aboveSubview:self.view];
  6. [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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜