在我的应用我的根视图控制器的TabBar 于一身的TabBar控制器I使用表格视图我想推视图控制器时,按细胞 但是当我使用PushViewController在tableview中
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
TripDetailView * TripDetailViewObjec = [[TripDetailView alloc]init];
[self.navigationController pushViewController:TripDetailViewObjec animated:YES];
}
不会做任何事情,是因为Self.navigation=null
和我尝试的AppDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
AppDelegate * ApplicationDelegate =[[UIApplication sharedApplication]delegate];
[[ApplicationDelegate Nav] pushViewController:TripDetailViewObjec animated:YES];
}
创建的UINavigationController我的AppDelegate
@interface AppDelegate : UIResponder <UIApplicationDelegate>
{
WeekendTrips * WeekendTripsObject ;
UINavigationController * Nav;
}
@property (strong, nonatomic) UIWindow *window;
@property (strong,nonatomic) UINavigationController * Nav;
@end
@implementation AppDelegate
@synthesize Nav;
@synthesize window = _window;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
WeekendTripsObject = [[WeekendTrips alloc]init];
Nav=[[UINavigationController alloc]initWithRootViewController:WeekendTripsObject];
[self.view addSubView Nav.view];
return YES;
}
,这不起作用 我可以做什么? 提前致谢
真的很感谢你们Midhun ......我问你更多的问题至今 –
@TefaMohamed:这是确定的家伙:) –