从XCode6 Swift中的SecondViewController.view调用Action按钮时崩溃

时间:2014-06-28 03:28:24

标签: uiviewcontroller swift ios8 xcode6

从SecondViewController.view调用操作按钮时,在 XCode6(Beta)/ Swift环境中会出现运行时错误。请参阅以下内容了解更多详情。

我的情景如下所示

  1. 尝试从' didFinishLaunchingWithOptions 中调用FirstView屏幕 以下工作正常。

    var varFirstViewController:firstViewController?= firstViewController(nibName:"firstViewController", bundle: nil)
    self.navigationController = UINavigationController(rootViewController:varFirstViewController)
    self.window!.rootViewController = self.navigationController"
    
  2. 从FirstViewController.view我试图通过以下代码调用第二个视图控制器工作正常

    let sec: SecondViewController = SecondViewController(nibName: nil, bundle: nil)
         self.view.addSubview(sec.view)
    
  3. 从试图触发ActionButton的secondViewController.view引发RunTime错误EXC_BAD_ACCESS

  4. 欣赏你的专业知识。

0 个答案:

没有答案