错误:accessing unknown 'view ' component of a property

解决方案 »

  1.   

    问题补充下:
    -(void)showFirstView{ 
    if(self.firstviewcontroller == nil){ 
    self.firstviewcontroller = [[FirstViewController alloc]initWithNibName:@"FirstView" bundle:nil]; 

    [self removeAllView]; 
    [self.view insertSubview:self.firstviewcontroller.view atIndex:0]; 

    -(void)showSecondView{ 
    if(self.secondviewcontroller == nil){ 
    self.secondviewcontroller = [[SecondViewController alloc]initWithNibName:@"SecondView" bundle:nil]; 

    [self removeAllView]; 
    [self.view insertSubview:self.secondviewcontroller.view atIndex:0]; 

    -(void)removeAllView{ 
    for(NSInteger i=0;i<[self.view.subviews count];i++){ 
    [[self.view.subviews objectAtIndex:i] removeFromSuperview]; 


    报错  3个错误:accessing unknown 'view ' component of a property求高手解答  急~~~~~~~
      

  2.   

    创建viewcontroller成功了,为撒要 [self removeAllView];?
      

  3.   

    [self removeAllView];  之后self.view 已经被释放了。
      

  4.   

    http://593134749.blog.163.com/blog/static/69235989201081171816947/
    我做的就是这个例子,一步一步做下来的,就是
    错误:accessing unknown 'view ' component of a property
    [self removeAllView];被我注释了以后,还是一样的错误,
    求指导,3Q
      

  5.   

    没太看出有啥问题, 把[self removeAllView];
    改成:[secondviewcontroller.view removeFromSuperview];试试那几个地方都相应修改下