title: Adding CoreData into an existing project using Objective-C
body: <p>I'm trying to create a data storage for my application using CoreData. From what I know, Xcode 8 CoreData is using <code>persistentContainer</code> instead of <code>managedObjectContext</code>.</p>
  
  <p>I've created a data model with my required entities and created an <code>NSManagedObject</code> subclass from the Editor menu.</p>
  
  <p>My problem is that when I want to use the <code>persistentContainer</code>, there is no identifier found.</p>
  
  <pre><code>#import "UserCredentials+CoreDataClass.h"
  
  //Fetch all username to array
  NSFetchRequest *fetchRequest = [[NSFetchRequest alloc]initWithEntityName:@"UserCredentials"];
  NSError *requestError = nil;
  
  
  //I couldn't find the persistent container even though I had imported my header file.
  NSArray *usernames = [self.persistentContainer.viewContext executeFetchRequest:fetchRequest error:&amp;requestError];
  </code></pre>
  
  <p>I realised that my CoreDataClass did not even have the property <code>persistentContainer</code> at all. Where can I declare this at, so I can access my data storage?</p>