UITableView empty, even after calling reloadData
<p>Kind of following this tutorial here: <a href="http://mobile.tutsplus.com/tutorials/iphone/iphone-core-data/" rel="nofollow">http://mobile.tutsplus.com/tutorials/iphone/iphone-core-data/</a></p>

<p>I use the fetch records method in my AppNameDelegate.m file. I then call reload on my tableview. Unlike the linked tutorial, I am not using a UITableViewController. Instead, I have added a table view to the NavigationController, and connected it to the IBOutlet variable called contactsTable. </p>

<p>Here's my code for calling and loading the data:</p>

<pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 

    [self.window addSubview:[self.navigationController view]];
    [self fetchRecords];
    [self.contactsTable reloadData];
    [self.window makeKeyAndVisible];
}
</code></pre>

<p>The header file:</p>

<pre><code>//
//  SimpleContactsAppDelegate.h
//  SimpleContacts
//
//  Created by Aaron McLeod on 11-05-28.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import &lt;UIKit/UIKit.h&gt;
#import &lt;CoreData/CoreData.h&gt;

@interface SimpleContactsAppDelegate : NSObject &lt;UIApplicationDelegate&gt; {
    NSManagedObjectModel *managedObjectModel;
    NSManagedObjectContext *managedObjectContext;
    NSPersistentStoreCoordinator *persistentStoreCoordinator;    
    UIWindow *window;  
    UINavigationController *navigationController;
    // view for adding new contacts
    UIViewController *newContactView;
    UIButton *addButton;

    // controls for the addContactView
    UIButton *saveContactButton;
    UITextField *nameField;
    UITextField *emailField;
    UITextField *phoneField;

    UITableView *contactsTable;
    NSMutableArray *contactArray;
}

@property (nonatomic, retain, readonly) NSManagedObjectModel *managedObjectModel;  
@property (nonatomic, retain, readonly) NSManagedObjectContext *managedObjectContext;  
@property (nonatomic, retain, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator;

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UINavigationController *navigationController;

@property (nonatomic, retain) IBOutlet UIButton *addButton;
@property (nonatomic, retain) IBOutlet UITableView *contactsTable;
@property (nonatomic, retain) NSMutableArray *contactArray;

// controller and fields for the form
@property (nonatomic, retain) IBOutlet UIViewController *newContactView;
@property (nonatomic, retain) IBOutlet UITextField *nameField;
@property (nonatomic, retain) IBOutlet UITextField *emailField;
@property (nonatomic, retain) IBOutlet UITextField *phoneField;
@property (nonatomic, retain) IBOutlet UIButton *saveContactButton;


- (NSString *)applicationDocumentsDirectory;
- (IBAction) saveContact;
- (IBAction) switchToAddContactView;
- (void)fetchRecords;
- (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView;
- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;

@end
</code></pre>

<p>You can find my project source code here as well: <a href="https://github.com/agmcleod/SimpleContacts/tree/parttwo" rel="nofollow">https://github.com/agmcleod/SimpleContacts/tree/parttwo</a> In case i left out code you might need. Thanks.</p>
