English 中文(简体)
iphone/ipad在添加和删除次视线
原标题:iphone/ipad adding adding and removing a subview doesnt work

在我的场面上,我稍有麻烦地提出新的看法,我有这样的守则:

- (void) showMyDayView {
NSLog(@"My Day View was touched");

MyDayViewController *temp = [[MyDayViewController alloc] initWithNibName: @"MyDayView" bundle:nil];
self.myDayViewController = temp;

NSLog(@"superview: %@", [[self mainNavView] superview]);
[[self mainNavView] removeFromSuperview];
NSLog(@"after removal main: %@", [self mainNavView]);
NSLog(@"after removal view: %@", [self view]);
NSLog(@"after removal superview: %@", [[self view] superview]);

[[[self view] superview] addSubview: [self.myDayViewController view]];

[temp release];
}

当我管理该法典时,奥索尔说,“除去了我(null)”

因此,当我对超级意见补充次意见时,不会发生任何情况,因为超级意见是无效的。

任何想法?

Thanks Mark

最佳回答

如果你想要再利用一种看法,即你将去除 综观,你必须首先保留。 摘除FromSuperview释放了援引的任何观点。

因此

[[self mainNavView] retain]
[[self mainNavView] removeFromSuperview];

[其本人的主要《纳文》]仍然可以安全使用。

问题回答

暂无回答




相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签