在线教程不起作用,请求不在结构或联盟中的成员?

时间:2011-08-15 19:39:48

标签: objective-c ios xcode

我是iOS开发的新手,所以我一直在网上关注如何制作下钻应用程序的一系列教程。我在两个版本上遇到了这个问题,我似乎无法克服它。我正在创建一个标签栏应用程序。在我的app委托中,我为我的.plist定义了一个标签栏,导航控制器,视图控制器和一个NSDictionary。问题是,当我到达我的ViewController.m的文件并开始告诉它使用我创建的导航控制器时,我收到错误“请求成员不是结构或联合。”

我已经尝试了两次,四次检查了代码,但我仍然没有得到它。任何帮助将不胜感激:)

下面是我的ViewController.m文件中的tableView方法。

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

//Get the dictionary of the selected data source.
NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row];

//Get the children of the present item.
NSArray *Children = [dictionary objectForKey:@"Children"];

if([Children count] == 0) {

    DetailViewController *dvController = [[DetailViewController alloc] initWithNibName:@"DetailView" bundle:[NSBundle mainBundle]];
    [self.indNavControl pushViewController:dvController animated:YES];
    [dvController release];
}
else {

    //Prepare to tableview.
    IndustriesViewController *indViewControl = [[IndustriesViewController alloc] initWithNibName:@"IndustryView" bundle:[NSBundle mainBundle]];

    //Increment the Current View
    indViewControl.CurrentLevel += 1;

    //Set the title;
    indViewControl.CurrentTitle = [dictionary objectForKey:@"Title"];

    //Push the new table view on the stack
    [self.indNavControl pushViewController:indViewControl animated:YES];

    indViewControl.tableDataSource = Children;

    [indViewControl release];
}

}

1 个答案:

答案 0 :(得分:0)

你是否合成了indNavControl?

相关问题