Cannot create a managed object context on iOS
Solution 1:
You need to import CoreData/CoreData.h in your application delegate's header file:
#import <CoreData/CoreData.h>
Since you probably use it through outyour application you should put it in the precompiled header file, YourApp-Prefix.pch:
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
#endif
Solution 2:
Just write #import < CoreData/CoreData.h > in your implementation file. It will work