为什么我的Hello World程序没有编译?

时间:2011-10-12 15:45:36

标签: iphone objective-c xcode delegates

我一直在关注如何使用xcode4和目标C创建基本iphone应用程序的HelloWorld教程。当我尝试从自动化课程中运行错误时,我没有那么多触动了。看到所有错误都在一个复杂的类中,我没有编辑,我完全不知道出了什么问题。我在某个时候意外地在那里输入了一些东西,但是马上将它解开了。

Warning: incomplete implementation
Error: Property Implementation must have it's declaration in interface "HelloWorldAppDelegate"
Error: No declaration of property 'window' found in interface
Warning: method definition for changeTheTextOnLabel not found


#import "HelloWorldAppDelegate.h"

#import "HelloWorldViewController.h"

@implementation HelloWorldAppDelegate


@synthesize window=_window;

@synthesize viewController=_viewController;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.

    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];
    return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application
{

}

- (void)applicationDidEnterBackground:(UIApplication *)application
{

}

- (void)applicationWillEnterForeground:(UIApplication *)application
{

}

- (void)applicationDidBecomeActive:(UIApplication *)application
{

}

- (void)applicationWillTerminate:(UIApplication *)application
{

}

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

@end

1 个答案:

答案 0 :(得分:1)

确保在HelloWorldAppDelegate.h文件中显示

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

我还要仔细检查.XIB文件中的窗口插座是否连接起来。