//代理 通常写在viewDidLoad里面
AppDelegate * delegate = [UIApplication sharedApplication].delegate;
self.context = [delegate managedObjectContext];
self.context = [delegate managedObjectContext];
//使用地点
WeiboEntity * weibo = [NSEntityDescription insertNewObjectForEntityForName:@"WeiboEntity" inManagedObjectContext:self.context];
添加coredata框架
在预编译引入框架