iphone开发 两个视图跳转问题(急,求指导!3Q)

iOS 码拜 9年前 (2015-05-09) 590次浏览 0个评论
 

错误:accessing unknown “”view “” component of a property

问题补充下:

-(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

求高手解答  急~~~~~~~

10分
创建viewcontroller成功了,为撒要 [self removeAllView];?
10分
[self removeAllView];  之后self.view 已经被释放了。
http://593134749.blog.163.com/blog/static/69235989201081171816947/
我做的就是这个例子,一步一步做下来的,就是
错误:accessing unknown “”view “” component of a property
[self removeAllView];被我注释了以后,还是一样的错误,
求指导,3Q
30分
没太看出有啥问题, 把[self removeAllView];
改成:[secondviewcontroller.view removeFromSuperview];试试

那几个地方都相应修改下


CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明iphone开发 两个视图跳转问题(急,求指导!3Q)
喜欢 (0)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!