2011-10-12 38 views
0

我一直在關注如何使用xcode4和目標C創建一個基本的iPhone應用程序的HelloWorld教程。當我嘗試從自動化類運行錯誤時,我沒有那麼感動。鑑於所有的錯誤都在我沒有編輯過的複雜課堂中,我完全不知道出了什麼問題。我無意中在某處輸入了一些東西,但立即解開了它。爲什麼我的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 
+2

聽起來像你的界面不包含'window'屬性。 –

+0

@George:讓這個答案,因爲它是正確的。 – JeremyP

回答

1

確保您的HelloWorldAppDelegate.h文件,這似乎

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

我會還仔細檢查你的.xib文件,窗口出口掛鉤。