我正在为 ipad 和 iphone 实现 TabBar 应用程序。但在 IPAD 中,导航控制器不适用于表格单元格中的 ipad 笔尖。viewdid Load 方法不是为 ipad 调用的。但它适用于 iphone .. self.navigationController 对于 ipad 为 NULL 仅在我的班级中导航。帮我!!
我的代码如下:
//Connet.m:
if(i==1)
{
TwitterController *tc;
if ([self isPad]) {
tc = [[TwitterController alloc] initWithNibName:@"TwitterController_ipad" bundle:nil];
}
else
tc = [[TwitterController alloc] initWithNibName:@"TwitterController" bundle:nil];
[self.navigationController pushViewController:tc animated:YES];
NSLog(@"%@",self.navigationController); /Problem ****NULL*****///////
//TWITTER.m
-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
//Custom initialization
self.navigationController.navigationBarHidden = YES;
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
self.navigationController.navigationBarHidden = YES;
NSString *urlAddress = @"https://twitter.com/UJUDGEIT1";
//Create a URL object.
NSURL *url = [NSURL URLWithString:urlAddress];
//URL Request Object
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
//Load the request in the UIWebView.
[webv loadRequest:requestObj];
}