【发布时间】:2011-10-12 15:45:36
【问题描述】:
我一直在关注关于如何使用 xcode4 和 Objective 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
【问题讨论】:
-
听起来您的界面不包含
window属性。 -
@George:回答这个问题,因为它是对的。
标签: iphone objective-c xcode delegates