Xcode中需要的标识符?我需要帮助!

Xcode中需要的标识符?我需要帮助!,xcode,ios,macos,Xcode,Ios,Macos,im开始使用3.2.6 iOS 4.3。现在我的问题是它告诉我有一个(位于“(@Implementation window,hvController;”)上): 应为标识符或“@”标记之前的“(” 在Delegate.m类中 //HelloUniverseAppDelegate.M (@Implementation window, hvController; (... //HelloUniverseAppDelegate.m - (void)applicationDidFinishishLau

im开始使用3.2.6 iOS 4.3。现在我的问题是它告诉我有一个(位于“(@Implementation window,hvController;”)上):

应为标识符或“@”标记之前的“(”

在Delegate.m类中

//HelloUniverseAppDelegate.M
(@Implementation window, hvController;
(...

//HelloUniverseAppDelegate.m
- (void)applicationDidFinishishLaunching:(UIApplication *)application {

    HelloUniverseController *hvc = [[HelloUniverseController alloc]
                                    inWihhNibName:@"HelloUniverse" bundle:[NSBundle mainBundle]];

    self.hvController = hvc;

    [hvc release];

    [window addSubview:[self.hvController view]];

    // Override point for customization after application launch
    [window makeKeyAndVisible ;
    }

     - (Void)dealloc {
         [hvController release];
         [window release];
         [super dealloc];
     }

     HelloUniverseController *hvc = [HelloUniverseController alloc];
     hvc = [hvc initWithNibName:@"HelloUniverse" bundle:[NSBundle mainBundle]];

#import "HelloUniverseAppDelegate.h"

@implementation HelloUniverseAppDelegate

@synthesize window;


#pragma mark -
#pragma mark Application lifecycle

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

    // Override point for customization after application launch.

    [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 when the user quits the application and it begins the transition to the background state.
     Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
     */
}


- (void)applicationDidEnterBackground:(UIApplication *)application {
    /*
     Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
     If your application supports background execution, called instead of applicationWillTerminate: when the user quits.
     */
}


- (void)applicationWillEnterForeground:(UIApplication *)application {
    /*
     Called as part of  transition from the background to the inactive state: here you can undo many of the changes made on entering the background.
     */
}


- (void)applicationDidBecomeActive:(UIApplication *)application {
    /*
     Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
     */
}


- (void)applicationWillTerminate:(UIApplication *)application {
    /*
     Called when the application is about to terminate.
     See also applicationDidEnterBackground:.
     */
}


#pragma mark -
#pragma mark Memory management

- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
    /*
     Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later.
     */
}


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


@end



now also its telling me I have a similar error in the Controller.h with

Expected Identifier before '{' token

its located on the "- (void)dealloc :{" line. the code I have for it is

#import <UIKit/UIKit.h>


@interface HelloUniverseController : UIViewController {

    IBOutlet UITextField *txtFirstName;
    IBOutlet UITextField *txtLastName;
    IBOutlet UILabel *lblMessage;
}

- (IBAction) btnClickMe_Clicked:(id)sender;

//HelloUniverseController.m

- (void)dealloc :{
[txtFirstName release];
[txtLastName release];
[lblMessage release];
[super dealloc];
}

@end
//HelloUniverseAppDelegate.M
(@实现窗口,hvController;
(...
//HelloUniverseAppDelegate.m
-(无效)应用程序完成发布:(UIApplication*)应用程序{
HelloUniverseController*hvc=[[HelloUniverseController alloc]
inWihhNibName:@“HelloUniverse”bundle:[NSBundle mainBundle]];
self.hvController=hvc;
[hvc释放];
[窗口添加子视图:[self.hvController视图]];
//应用程序启动后自定义的覆盖点
[window makeKeyAndVisible;
}
-(无效)解除锁定{
[控制器释放];
[窗口释放];
[super dealoc];
}
HelloUniverseController*hvc=[HelloUniverseController alloc];
hvc=[hvc initWithNibName:@“HelloUniverse”bundle:[NSBundle mainBundle]];
#导入“HelloUniverseAppDelegate.h”
@实现HelloUniverseAppDelegate
@合成窗口;
#布拉格标记-
#pragma标记应用程序生命周期
-(BOOL)应用程序:(UIApplication*)应用程序使用选项完成启动:(NSDictionary*)启动选项{
//应用程序启动后自定义的覆盖点。
[self.window makeKeyAndVisible];
返回YES;
}
-(无效)应用程序将重新签名:(UIApplication*)应用程序{
/*
当应用程序即将从活动状态移动到非活动状态时发送。这可能发生在某些类型的临时中断(如来电或短信)或用户退出应用程序并开始转换到后台状态时。
使用此方法暂停正在进行的任务、禁用计时器和降低OpenGL ES帧速率。游戏应使用此方法暂停游戏。
*/
}
-(无效)应用程序标识符背景:(UIApplication*)应用程序{
/*
使用此方法释放共享资源、保存用户数据、使计时器无效,并存储足够的应用程序状态信息,以便在应用程序稍后终止时将其恢复到当前状态。
如果应用程序支持后台执行,则调用而不是applicationWillTerminate:当用户退出时。
*/
}
-(无效)应用程序将进入前台:(UIApplication*)应用程序{
/*
作为从后台转换到非活动状态的一部分调用:在这里,您可以撤消在进入后台时所做的许多更改。
*/
}
-(无效)应用IDBECOMEACTIVE:(UIApplication*)应用{
/*
重新启动应用程序处于非活动状态时暂停(或尚未启动)的所有任务。如果应用程序以前位于后台,可以选择刷新用户界面。
*/
}
-(无效)申请将终止:(UIApplication*)申请{
/*
当应用程序即将终止时调用。
另请参见ApplicationIdentinterBackground:。
*/
}
#布拉格标记-
#pragma标记内存管理
-(无效)应用程序IDReceiveMemoryWarning:(UIApplication*)应用程序{
/*
通过清除以后可以重新创建(或从磁盘重新加载)的缓存数据对象,释放尽可能多的内存。
*/
}
-(无效)解除锁定{
[窗口释放];
[super dealoc];
}
@结束
现在它也告诉我,我在控制器中有一个类似的错误
“{”标记之前应为标识符
它位于“-(void)dealloc:{”行上
#进口
@接口HelloUniverseController:UIViewController{
IBOutlet UITextField*txtFirstName;
IBOutlet UITextField*txtLastName;
IBUILabel*LBL消息;
}
-(iAction)已单击的btnClickMe_:(id)发件人;
//HelloUniverseController.m
-(无效)解除锁定:{
[txtFirstName发布];
[txtLastName发布];
[LBL信息发布];
[super dealoc];
}
@结束
我在这方面也很新,我使用mactonish的第二天,以及使用Xcode的第一天。

删除这个

(
以前

(@implementation
去掉这个

(
以前

(@implementation

Objective-C要求类有两部分:接口(通常出现在.h文件中并声明类的实例变量、属性和方法)和实现(应该出现在.m文件中并定义类的方法)。您似乎试图在@interface块中定义
-dealoc
方法而不是在@implementation块中,这至少会导致一个错误

坦率地说,我们无法避免这样的印象,即您是在对语言不太了解的情况下从某处复制和粘贴代码的。有许多明显的错误根本没有任何意义,包括我刚才描述的错误和#import语句,它似乎是您的
-applicationdFinishLaunching
方法


StackOverflow是一个很棒的社区,我相信,它会很乐意在您学习编程的过程中帮助您。但是,如果您没有努力学习该语言的基本语法,您将很快失去您的欢迎。更重要的是,如果我们一直纠正您的错误,它真的不会帮助您。请,请阅读。或者,如果您对C语言(C,C++,C,java,……)没有任何经验。考虑到iPhone和iPad的巨大流行度,有很多书可供选择。

< P> Objto-C要求类有两个部分:接口,通常出现在.h文件中,并声明类的实例变量p属性和方法;以及应该在.m文件中并定义类的方法的实现。您似乎试图在@interface块中定义
-dealloc
方法,而不是在@implementation块中定义