core-dataxcode8encrypted-core-data-sql

xcode8 beta4 not generating the managedObjectContext


I am using a blank core data proj and trying to copy the code from this examples.

https://www.and rewcbancroft.com/2015/02/18/core-data-cheat-sheet-for-swift-ios-developers/

As there is no managedContext i am not able o proceed.

I am new to IOS programming. Please can anybody share me a simple example that i can start with. But i need it with Xcode8 beta4 version. I tried many other examples but once i convert them to my current version they are not working.

enter image description here


Solution

  • The error message reads:

    Value of type 'ViewController' has no member 'managedObjectContext'

    What this means is that somewhere (your screenshot does not show where) you are attempting to assign a value to a property named managedObjectContext, on an instance of your ViewController class. Except that this class doesn't have a property named managedObjectContext, so Swift complains and doesn't compile.

    This is not actually a Core Data question-- it's basic Swift. It would happen for any attempt to assign a value to a nonexistent property.

    You probably (again, your screenshot does not provide enough detail to be sure) need to create this property on your view controller class, with type NSManagedObjectContext.