This is the code, i'm trying to make the 'self.viewController' work, but it is giving me an error. What do i need to do to fix this. I am getting the error as stated above in the header of this thread.
#import "AppDelegate.h"
#import "ViewController.h"
#import "Name.h"
@interface AppDelegate ()
-(Name *)createNameWithNonsenseDataWithIndex:(int)index;
@end
@implementation AppDelegate
@synthesize tableData;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
return YES;
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
//Create dummy data
NSUInteger numberOfNames = 25;
self.tableData = [[NSMutableArray alloc] initWithCapacity:numberOfNames];
//Create a temporary array of tableData
for (NSUInteger i = 0; i < numberOfNames; i++) {
//Create a new name with nonsense data
Name *tempName = [self createNameWithNonsenseDataWithIndex:1];
//Add it to the temporary array
[self.tableData addObject:tempName];
}
self.viewController = [[ViewController alloc]
initWithNibName:@"viewController" bundle:nil];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}