我在view中创建了一个新的view1,然后addsubview之后怎么处理view1才好?
CustomViewController *customViewController = [[CustomViewController alloc] initWithNibName:@"CustomViewController "];
[self.view addsubview:customViewController.view];
[customViewController release]; 如上:如果我release customViewController self.view 上面显示的会只有一个customViewController.view的一个最上面的toolbar跳显示。可是如果我不release的话,会出现内存泄露吧。这个要怎么处理好。
我有用 [[[CustomViewController alloc] initWithNibName] autorelease] 效果与后面release是一样的。
求高手指点好的解决方案,最好讲解一下具体的原因,不胜感激。
CustomViewController *customViewController = [[CustomViewController alloc] initWithNibName:@"CustomViewController "];
[self.view addsubview:customViewController.view];
[customViewController release]; 如上:如果我release customViewController self.view 上面显示的会只有一个customViewController.view的一个最上面的toolbar跳显示。可是如果我不release的话,会出现内存泄露吧。这个要怎么处理好。
我有用 [[[CustomViewController alloc] initWithNibName] autorelease] 效果与后面release是一样的。
求高手指点好的解决方案,最好讲解一下具体的原因,不胜感激。
解决方案 »
- cocos2d-x程序莫名其妙的弹出中断界面
- UIView animation 里面的center值变化了,但是KVO监听不到?
- iOS7 系统原生的分享有办法调用吗?
- UIImagePickerController 不走Delegate方法
- ios 中怎么使用静态函数的指针
- [NSThread isMainThread]返回值可靠吗
- Segue跳转到新界面,ImageView居然延时显示了
- xcode支持混编,可为什么都很少用C++和JAVA写?
- itools这样的程序是如何获取iphone信息的?
- ios测试
- 怎样找出NSString中字母 数字 中文 特殊字符的个数?
- iphone 备份问题,求各位大神指点!!!急!!!!!!
customViewController.view中有toolbar的,在后面release掉它之后,最后的显示结果会是,只显示了customViewController.view的toolbar,其他的没有显示出来。