【问题标题】:iOS UINavigationController PushViewController is not workingiOS UINavigationController PushViewController 不工作
【发布时间】:2014-07-05 07:03:00
【问题描述】:

我使用了一个类,这个类的超类是 UIView 类,我可以使用 pushviewcontroller 推送到其他视图控制器

.h 文件

@class AppDelegate;

@interface BarButton : UIView  
{

      AppDelegate *appDelegate;

}

@property(retain,nonatomic)AppDelegate *appDelegaet;

.m 文件

appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];

-(IBAction)btn4Click:(id)sender

{

    OrderViewController *orderView=[[OrderViewController alloc] 
       initWithNibName:@"OrderViewController" bundle:nil];
    [appDelegate.navObj.navigationController pushViewController:orderView animated:YES];

}

【问题讨论】:

  • AppDelegate 类中的 navObj 是什么。让我知道它的类型或类别。
  • 我可以使用自定义类,并且该类超类是此类中的 UIView 类,我可以推送到其他视图控制器代码
  • navObj 是 UINavigationcontroller 对象,可以在 AppDelegate 中声明

标签: iphone ios7 uinavigationcontroller


【解决方案1】:

请更新你的这行代码

[appDelegate.navObj.navigationController pushViewController:orderView animated:YES];

[appDelegate.navObj pushViewController:orderView animated:YES];

【讨论】:

  • 如果你认为这个答案是正确的,你可以接受!!享受编码!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-09-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-09-23
  • 1970-01-01
  • 2011-04-02
相关资源
最近更新 更多