我是iOS开发的新手,所以我一直在网上学习如何制作下钻应用程序的教程。我在两个构建中遇到了这个问题,我似乎无法克服它。我正在创建一个标签栏应用程序。在我的app委托中,我为我的。plist定义了标签栏,导航控制器,视图控制器和NSDictionary。问题是,当我到达我的ViewController。m的文件并开始告诉它使用我创建的导航控制器,我得到错误"请求成员不是结构或联合"。
我已经试了两次,检查了四遍代码,但我仍然不明白。任何帮助都将是非常感激的:)
下面是我的ViewController的tableView方法。m文件。
- (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];
}
}
是否合成了indNavControl?