As you have not specified whether it's Swift or Objective-C, I'll kick that it's Objective-C. But the process in Swift is similar.
Select the project in Project Navigator
- > Build Phases
and Link Binary With Libraries
remove CoreData.framework
(Skip this step if it is Swift) Look for the .pch file for your project. Usually the default is: [Your project name] -Prefix.pch . Remove the line from #import <CoreData/CoreData.h>
Delete any *. Model file.
No AppDelegate.h
delete the following properties and methods (Swift are lazy var
of same name):
-
@property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext;
@property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel;
@property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;
-
- (void)saveContext;
- (NSURL *)applicationDocumentsDirectory;
(Skip this step if it is Swift) In AppDelegate.m
remove @synthesize
from the properties you just removed:
-
@synthesize managedObjectContext = _managedObjectContext;
@synthesize managedObjectModel = _managedObjectModel;
@synthesize persistentStoreCoordinator = _persistentStoreCoordinator;
Still in AppDelegate.m
delete the following methods:
-
saveContext
managedObjectContext
managedObjectModel
persistentStoreCoordinator
applicationDocumentsDirectory
Finally, even in AppDelegate.m
, within method applicationWillTerminate
remove the call from method [self saveContext]
That's right, you got rid of CoreData!