Terminating app due to uncaught exception 'NSInternalInconsistencyException'
<p>I am working with coredata..I have taken a  navigation based app with coredata option checked..so in my first page will be a default tableview controller ,I addded an add button which opens another table view and i called it "anothertableviewcpntroller"
the code which I wrote to on a add barbutton is below</p>

<pre><code>- (void)insertNewObject {
     DetailsTable *details = [[DetailsTable alloc] initWithNibName:@"DetailsTable" bundle:[NSBundle mainBundle]];
     UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController: details];
     [self.navigationController presentModalViewController:navController animated:YES];
     [details release];
}
</code></pre>

<p>Then it opens the table view which,I have populated it with some dummy names ,and when I click on the first cell it opens one more view called <code>detailviewcontroller</code>,
the code written on click of cells is below</p>

<pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

{
    // Navigation logic may go here. Create and push another view controller.
    /*
     &lt;#DetailViewController#&gt; *detailViewController = [[&lt;#DetailViewController#&gt; alloc] initWithNibName:@"&lt;#Nib name#&gt;" bundle:nil]    
     // ...
     // Pass the selected object to the new view controller.
     [self.navigationController pushViewController:detailViewController animated:YES];
     [detailViewController release];
     */
    if(indexPath.row == 0)
    {
        AddRecipeViewController *addRecipeView = [[AddRecipeViewController alloc] initWithNibName:@"AddRecipeViewController" bundle:[NSBundle mainBundle]];
        Recipes *recipes = (Recipes *)[NSEntityDescription insertNewObjectForEntityForName:@"Recipes" inManagedObjectContext:self.managedObjectContext];
            addRecipeView.recipes = recipes;    
             UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController: addRecipeView];
             [self.navigationController presentModalViewController:navController animated:YES];
             [addRecipeView release];        
 }
}
</code></pre>

<p>Here I have a text field where the user will add his name and click on save button,</p>

<p>The code for save button is below</p>

<pre><code>- (void)save {
     recipes.recipeName = textFieldOne.text;
     recipes.cookingTime = textFieldTwo.text;
     NSLog(recipes.recipeName);
     NSError *error = nil;   
     if (![recipes.managedObjectContext save:&amp;error]) {
          // Handle error
          NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
          exit(-1);  // Fail
     }
     [self dismissModalViewControllerAnimated:YES];
}
</code></pre>

<p>When he clicks on save button,the data should appear on the firstpage tableview controller,but its not happening I am getting the above error..i.e</p>

<blockquote>
  <p>Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+entityForName: could not locate an NSManagedObjectModel for entity name 'Recipes'' </p>
</blockquote>

<p>Can someone help me out.</p>
