taskTable not recognized as instance variable


I’m trying to build iTahDoodle and am stuck on an early section in the didFinishLaunchingWithOptions method.

Here’s the header file:

#import <UIKit/UIKit.h>
NSString *docPath(void);

@interface BNRAppDelegate : UIResponder

UITextField *taskField;
UIButton *insertButton;
UITableView *taskTable;

NSMutableArray *tasks;


  • (void) addTask:(id)sender;

@property (strong, nonatomic) UIWindow *window;


Here’s the implementation file for the method
#import “BNRAppDelegate.h”

NSString *docPath()
NSArray *pathList = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
return [[pathList objectAtIndex:0] stringByAppendingPathComponent:@“data.td”];

@implementation BNRAppDelegate

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    NSArray *plist =[NSArray arrayWithContentsOfFile:docPath()];
    tasks = [plist mutableCopy];
    } else {
    tasks = [[NSMutableArray alloc] init];
    CGRect tableFrame = CGRectMake(0,80,320,380);
    CGRect fieldFrame = CGRectMake(20,40,200,31);
    CGRect buttonFrame = CGRectMake(228,40,72,31);

    taskTable = [[[UITableView alloc] initWithFrame:tableFrame
    // an error here – red print – “expected identifier” — and taskTable appears black (greeen for instance variables)

    [taskTable setSeparatorStyle:UITableViewCellSeparatorStyleNone];

    taskField = [[UITextField alloc] initWithFrame:fieldFrame];
    [taskField setBorderStyle:UITextBorderStyleRoundedRect];

    [taskField setPlaceholder:@“Type a task, tap Insert”];

    // create and configure a rounded rect Insert Button
    insertButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    [insertButton setFrame:buttonFrame];
    [insertButton addTarget:self
    [insertButton setTitle:@"Insert"
    [[self window] addSubview:taskTable];
    [[self window] addSubview:taskField];
    [[self window] addSubview:insertButton];

               [[self window] setBackgroundColor:[UIColor whiteColor]];
               [[self window] makeKeyAndVisible];
               return YES;


  • (void)applicationWillResignActive:(UIApplication *)application
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or…