0
我是Objective C
和Swift
的新手。在我的示例程序中,我有一个例外'NSInternalInconsistencyException'
。我做以下步骤,这是我在斯威夫特第一个程序,我没有目的C.熟悉Swift中的'NSInternalInconsistencyException'
- 创建一个空的应用程序名称为SampleTesting
- 创建一个CheckingController.xib
- 创建一个AppDelegate.swift
- 创建一个CheckingController.swift
CheckingController.xib:
我创建了一个Sample Button
。
AppDelegate.swift:
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
var navigationController: UINavigationController?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
// Override point for customization after application launch.
self.window!.backgroundColor = UIColor.whiteColor()
self.window!.makeKeyAndVisible()
var mainController: CheckingController? = CheckingController(nibName: "CheckingController", bundle: nil)
self.navigationController = UINavigationController(rootViewController: mainController)
self.window!.rootViewController = self.navigationController
return true
}
func applicationWillResignActive(application: UIApplication) {
}
CheckingController.swift:
import Foundation
import UIKit
class CheckingController: UIViewController{
init(nibName nibNameOrNil: String!, bundle nibBundleOrNil: NSBundle!) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
}
override func viewDidLoad() {
super.viewDidLoad()
}
}
需要上出了什么问题怎么回事,以及如何解决它的一些指导。
谢谢。
它很好,你已经找到自己的解决方案 –
@NagaMalleshMaddali感谢您的愿望:) :) –