Compile Problem with Bowties Starter Project

I’m working through the Core Data by Tutorials (Second ed, IOS9, Xcode 7 and Swift2). I have downloaded the tutorial projects and am having difficulty with the Bowties starter project (Chap 2). On p.50 we have to update the appDelegate.swift file, creating a viewController and then assign managedContext field. But when I try this I get compile error “Value of type ‘ViewController’ has no member ‘managedContext’”. However, when I try the completed project, that compiles OK. I then copied the didFinishLaunch… method from the final to the starter and it still didn’t work so I think it may be a build configuration but I’m not sure. I suspect that this might be an elementary error on my part but if someone has the solution I’d be pleased to hear it. (My Xcode version is 7.2.1, OSX 10.11.3)

I managed to sort this out by deleting the app from the simulator and re-running. Suddenly it started to work. Not sure why