更新:すべての作業は、.xibファイルのビューをリンクするのを忘れていました。.h実装ファイルは私のUIViewControllerを認識しません。
私はビューコントローラの実装ファイルをインポートしました。
TopicsListParentViewController *tlparentview;
が最初では、エラーはありませんが、プロジェクトをビルドするときに、このエラーが表示されます:
#import "TopicsListParentViewController.h"
は私が書くとき
不明なタイプ名 'TopicsListParentViewControllerを';あなたは 'TopicsListViewController'を意味しましたか?
なぜこれを解決できますか?ここでは、より正確なシーンを想像するのに役立つスクリーンショットです:
EDIT:
:ここでは "TopicsListParentViewController".hの実装ファイル用の.hと.mファイルがあります
// // TopicsListParentViewController.h // // Created by James Anderson on 27/04/2012. // Copyright (c) 2012 PixelBit Apps Ltd. All rights reserved. // #import "SuperChatAppDelegate.h" #import "TopicsListViewController.h" @interface TopicsListParentViewController : UIViewController { IBOutlet UIView *parentview; IBOutlet TopicsListViewController *topicsListViewController; } @end
.m実装ファイル:
//
// TopicsListParentViewController.m
//
// Created by James Anderson on 27/04/2012.
// Copyright (c) 2012 PixelBit Apps Ltd. All rights reserved.
//
#import "TopicsListParentViewController.h"
@implementation TopicsListParentViewController
-(void)viewDidLoad
{
[parentview addSubview:topicsListViewController.tableView];
NSLog(@"Added subview");
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations.
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
- (void)dealloc {
[super dealloc];
}
@end
あなたは私たちに.hと.mのTopicsListParentViewController ..を表示できますか? –
ファイル名を確認してください...変更される可能性があります... – Nit
TopicsListParentViewController.hでクラス名を確認してください。 – tia