I am new to Objective C
and Swift
. Here I am having an exception as 'NSInternalInconsistencyException'
in my sample program. I do the following steps and this is my first program in Swift and I am not familiar in Objective C.
CheckingController.xib:
I have created a 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()
}
}
Need some guidance on what could be going wrong here and how to resolve it.
Thanks.
I followed the below steps and i fixed the error:
Refered here
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.