Ios 为什么设置导航栏颜色会导致Xcode崩溃?

Ios 为什么设置导航栏颜色会导致Xcode崩溃?,ios,objective-c,xcode,Ios,Objective C,Xcode,我将下面的代码添加到NavigationController.m,但是当我尝试在模拟器中运行应用程序时,它会崩溃Xcode。这个代码有什么问题 - (void)viewDidLoad { [super viewDidLoad]; [self.view addGestureRecognizer:[[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureRecognized:)]];

我将下面的代码添加到
NavigationController.m
,但是当我尝试在模拟器中运行应用程序时,它会崩溃Xcode。这个代码有什么问题

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self.view addGestureRecognizer:[[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureRecognized:)]];

    if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
        // iOS 6.1 or earlier
        self.navigationController.navigationBar.tintColor = [UIColor redColor];
    } else {
        // iOS 7.0 or later
        self.navigationController.navigationBar.barTintColor = [UIColor redColor];
        self.navigationController.navigationBar.translucent = NO;
    }

}
-(void)viewDidLoad
{
[超级视图下载];
[self.view addgestureRecognitzer:[[UIPangestureRecognitzer alloc]initWithTarget:self action:@selector(PangestureRecognited:)];

if(楼层(NSFoundationVersionNumber)哪个模拟器?6.1或更高版本?你能提供一点关于你的崩溃的上下文吗?你为你的手势识别器实现了回调吗?他问的是哪个模拟器版本不是iOS。请提供崩溃日志。没有崩溃日志。Xcode与模拟器一起完全崩溃。但是,是的,6.1