明らかに、私はiOS開発の新人ですが、本当に誰かの助けを使うことができます。 .plistsをドリルダウンテーブルビューにロードしようとしているタブバーアプリケーションをビルドしています。問題は、ViewControllerのタブのナビゲーションコントローラを使用しようとしているので、このメソッドを正しく取得できないように見えることです。私の誤りは2番目の行にあると私は肯定的です。UIApplication sharedApplicationを使用するとエラーが発生しますか?
A37dgAppDelegate *AppDelegate = (A37dgAppDelegate *)[[UIApplication sharedApplication] delegate];
AppDelegate.indNavControl *indNavControl;
その後、いくつかのエラーが発生します。ここでは、コードで、エラーがどこにあるか私は指摘します:
if([Children count] == 0) {
DetailViewController *dvController = [[DetailViewController alloc] initWithNibName:@"DetailView" bundle:[NSBundle mainBundle]];
[self.indNavControl pushViewController:dvController animated:YES];//Property "indNavControl" not found on object of type "IndustriesViewController"
[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]; //Property "indNavControl" not found on object of type "IndustriesViewController"
indViewControl.tableDataSource = Children;
[indViewControl release];
}
}
ただ、明確にするために、私は私のアプリデリゲートのヘッダファイルをインポートしています。任意の助けが大いに感謝されるでしょう:)
私はあなたのコードを時間のクーペを読んだが、私はそれを理解していない。具体的には 'AppDelegate.indNavControl * indNavControl;' - それは合法ですか?それは何をしようとしていますか?第2に、エラーから、2番目のコードブロックがIndustriesViewControllerから来て、そのクラスにindNavControlプロパティがないように見えます。これら2つのコードセクションがどのように関連しているのか、なぜアプリケーションデリゲートを実行する必要があるのか分かりません。また、IndustriesNavController内からIndustriesNavControllerを割り当てようとしているようです。または私は何かを逃していますか? :-) – drekka