【问题标题】:I am not able to remove subView in detailView from rootViewController我无法从 rootViewController 中删除详细视图中的子视图
【发布时间】:2012-04-25 05:55:16
【问题描述】:

我有多个详细视图,当我单击 rootViewController 中的选择第二行时,我删除了详细视图并从 appDelegate 添加了一个新视图。当我这样做时,我无法将值从 rootView 发送到 newDetailView。 这就是我在我的 appdelegate 中所做的

    [splitViewController.view removeFromSuperview];

    arcObj = [[Architecture alloc] init];
    UINavigationController *detailNav=[[UINavigationController alloc]initWithRootViewController:arcObj];
    [arcObj release];
    splitViewController.viewControllers=[NSArray arrayWithObjects:rootViewController,detailNav,nil];
    splitViewController.delegate=arcObj;

在 rootVeiwController 中

NewdetailViewController.detailItem = @"gettingin";

在我的 newDetailView 中

- (void)setDetailItem:(id)newDetailItem {
if (detailItem != newDetailItem) {
    [detailItem release];
    detailItem = [newDetailItem retain];
}}

它没有调用方法

 - (void)setDetailItem:(id)newDetailItem

任何帮助???

【问题讨论】:

    标签: iphone ios ipad uisplitviewcontroller


    【解决方案1】:

    你需要使用 -

    [NewdetailViewControllerObject setDetailItem:@"gettingin"];
    

    【讨论】:

    • 我也试过了......它不起作用,......可能是什么错误?
    • 你需要通过对象而不是 Class 调用它,因为它不是类方法。我认为这就是问题所在。编辑我的答案。
    • 是的,这就是我所说的,NewdetailViewControllerObject 是类 NewdetailViewController 的对象。
    • 不,它不工作我的朋友......这就是我不理解的错误...... :(
    猜你喜欢
    • 2013-03-16
    • 2020-12-13
    • 1970-01-01
    • 2011-01-25
    • 1970-01-01
    • 1970-01-01
    • 2012-08-10
    • 2020-10-30
    • 1970-01-01
    相关资源
    最近更新 更多