我想在我的应用中转换屏幕,但无法完成。 我使用TabBarController,我制作了Tab1项和Tab2项。 当我在我的模拟器中点击Tab2时,我的应用程序掉线了。
import UIKit
import SwiftyJSON
class ViewController: UIViewController {
@IBOutlet var KenshinPic: UITabBarItem!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
extension ViewController : UITabBarControllerDelegate {
public func tabBarController(tabBarController: UITabBarController, viewController: UIViewController) -> Bool {
if(viewController.restorationIdentifier == "first") {
self.tabBarController!.setViewControllers([KenshinSendController() , KenshinViewController()], animated: false);
let items = self.tabBarController!.tabBar.items;
items![1].title = "Second";
items![0].title = "First";
return false;
}
return true;
}
}
Below sentences didn't be called in Xcode when I run my app.
enter code here
self.tabBarController!.setViewControllers([KenshinSendController() , KenshinViewController()], animated: false);
错误消息是'信号SIGABRT'
AppDelegate类中的:UIResponder,UIApplicationDelegate {
AppDelegate文件的。
我该怎么办?