-1

I am using Apple's newest Xcode for MacOS 10.7(Lion). I am trying to make a iPhone application. I'm new to the language and decided to load up apples guides. 'Your first iOS application'. It was good, taught me a few things but Its not working. I get Expected Getter Method Not Found On Object Of Type 'TestAppDelegate *'

How do i Fix this?

Heres the code:

TestAppDelegate.m

#import "TestAppDelegate.h"
#import "MyViewController.h"

@implementation TestAppDelegate


@synthesize window=_window;
@synthesize myViewController=_myViewController;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

MyViewController *aViewController = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil];
self.myViewController = aViewController;
// Or, instead of the line above:
// [self setMyViewController:aViewController];
[aViewController release];
self.window.rootViewController = self.MyViewController;
[self.window makeKeyAndVisible];

return YES;
}

/* Other methods omitted from the listing. */

- (void)dealloc {
[_myViewController release];
[_window release];
[super dealloc];
}

@end

The line:

self.window.rootViewController = self.MyViewController;

Has the problem

Tyler McMaster
  • 1,407
  • 2
  • 14
  • 15

2 Answers2

2

objective-c is case-sensitive. You wrote an upper-case M instead of lower-case.

self.window.rootViewController = self.myViewController;
Colin
  • 3,670
  • 1
  • 25
  • 36
1

Your window doesn't exist yet (at least from what I can see in your code). Add this before the line causing the SIGABRT:

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
dtuckernet
  • 7,817
  • 5
  • 39
  • 54