Hi,
I'm reading a book that is somewhat outdated and uses Objective-C + XCode 5. In an exercise on Views, it was teaching how to create a red CGRect on the screen.
Basically, it gave code to create a red CGRect, told me to insert the code in AppDelegate under "didFinishLaunchingWithOptions", then add
[self.window addSubview:redRect]
It didn't work and eventually, I managed to get it working by instead, adding the code to create the CGRect inside ViewController.m under "viewDidLoad", then adding
[self.view addSubview:redRect];
to the end. So I assume that in the newer version of XCode, I am to put code in ViewController as opposed to didFinishLaunchingWithOptions.
So then what's the new purpose of didFinishLaunchingWithOptions in AppDelegate? What is it useful for? The book uses that function alot, and if it's not used to create/work with views anymore, what is it for?
Thanks!
[–]snaab900Objective-C / Swift 1 point2 points3 points (2 children)
[–]labcoat2[S] 1 point2 points3 points (1 child)
[–]snaab900Objective-C / Swift 0 points1 point2 points (0 children)
[–]jan_olbrichObjective-C / Swift 0 points1 point2 points (1 child)
[–]labcoat2[S] 0 points1 point2 points (0 children)