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感謝您的願望:) :) –