i was trying to read the big nerd ranch book for ios 7. I know it's old but it has very interesting topic and i believe its one of the best written and the best book for learning.
The problem is that i use xcode 6.1 and the templates are totally different. I would also want to translate their Objective-c code into Swift.
The translation part was easy but i got a major issue in doing something probably silly.
This is my code
AppDelegate
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
var firstframe:CGRect = CGRectMake(160, 240, 100, 150)
var firstView:HypnoView = HypnoView(frame:firstframe)
firstView.backgroundColor = UIColor.redColor()
self.window?.addSubview(firstView)
return true
}
}
HypnoView
import UIKit
class HypnoView: UIView {
var frameView:CGRect = CGRectNull
override init(frame: CGRect) {
frameView = frame
super.init(frame: frame)
}
required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
}
This is the error i get
2014-11-07 20:32:41.408 Hypno[7987:450667] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'Main' in bundle NSBundle (loaded)'
the app still look for the main storyboard file, but i can't find where it's linked... how can i fix this so i can just start with my own ViewController, without eventually using storyboard? where it's the code that should've been in the app delegate that loads everything? thanks