2011-12-15 54 views
0

嗨,我刚开始开发iPhone应用程序,这是我的第一天。我必须使用一些同事给我的代码(他有xcode 4.1或4.2),只是为了快速尝试它,但它不编译,我不明白为什么。我有iphone SDK 3.1和xcode 3.2(我认为)。更新到任何其他版本是不可能的,所以有没有办法可以解决这些编译错误? 我收到以下错误,在iLikeItAppDelegate.m在不同xcode版本之间编译iphone?

@synthesize window=_window; 
!synthesized property 'window' must either be named the same as a compatible iva or must  
explicitly name an ivar 
@synthesize viewController=_viewController; 
!kind of similar comment here 
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: 

(NSDictionary *)launchOptions 
{ 
// Override point for customization after application launch. 

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

当我打开我试图编译该项目和它说没有发现一些有关的iPhoneOS和我把它改成我有软件开发工具包之一,现在我得到这些奇怪的错误。请人帮我感谢

编辑:我设法取代其他一些工作人员,现在我有这个类:

#import "iLikeItAppDelegate.h" 

#import "iLikeItViewController.h" 

@implementation iLikeItAppDelegate 


@synthesize window; 

@synthesize viewController; 

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: 

(NSDictionary *)launchOptions 
{ 
// Override point for customization after application launch. 
//self.window.viewController 

//self.window.rootViewController = self.viewController; 
[window addSubview:viewController.view]; 
[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, this method is called instead of applicationWillTerminate: when the user quits. 
*/ 
} 

- (void)applicationWillEnterForeground:(UIApplication *)application 
{ 
/* 
Called as part of the 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. 
Save data if appropriate. 
See also applicationDidEnterBackground:. 
*/ 
} 

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

@end 

,但是我现在有另一个编译错误,那些我甚至不明白:

“__Block_object_dispose”,从引用:

___destroy_helper_block_1 in iLikeItViewController.o 


    ___destroy_helper_block_3 in iLikeItViewController.o 


    ___destroy_helper_block_4 in iLikeItViewController.o 


    ___destroy_helper_block_2 in iLikeItViewController.o 

“__Block_object_assign”,从引用:

___copy_helper_block_1 in iLikeItViewController.o 


    ___copy_helper_block_3 in iLikeItViewController.o 


    ___copy_helper_block_4 in iLikeItViewController.o 


    ___copy_helper_block_2 in iLikeItViewController.o 

“__NSConcreteStackBlock”,从引用:

__NSConcreteStackBlock$non_lazy_ptr in iLikeItViewController.o 


(maybe you meant: __NSConcreteStackBlock$non_lazy_ptr) 

LD:符号(S)没有发现

collect2:LD返回1退出状态

任何人可以帮助PLZ我需要学习这些基本步骤,将xcode 4 projetcs转换为3,因为我拥有雪豹,这是系统允许我安装的最新版本。

回答

1

RootViewController的财产的iOS 4.0及更高版本,read here

我的建议是:获得最新的SDK

+0

THKS你的答案,我终于成功地纠正了一些工作人员只能在Xcode 3,你可以看到在我的编辑,但现在我有另一个问题。 (对不起,但无法更新到xcode4) – vallllll 2011-12-15 15:02:31