Possible Duplicate:
Adding Core Data to existing iPhone project
Initially i have created project with out selecting coreData. After some point of development i want to use core data for data management. It's giving some exception like
context = [[NSManagedObjectContext alloc] init];
CDAlbum *albumInfo = [NSEntityDescription insertNewObjectForEntityForName:@"CDAlbum" inManagedObjectContext:context];
albumInfo.albumName = @"MyAlbum";
CDPage *pageInfo = [NSEntityDescription insertNewObjectForEntityForName:@"CDPage" inManagedObjectContext:context];
pageInfo.message = @"It's my message";
pageInfo.pageId = @"123456";
pageInfo.album = albumInfo;
albumInfo.page = pageInfo;
'NSInternalInconsistencyException', reason: '+entityForName: could not locate an NSManagedObjectModel for entity name 'CDAlbum'
I think this is because of linking. How can I resolve it?
Thanks.