不同的xcode版本之间的iPhone编译?

时间:2011-12-15 13:27:09

标签: iphone xcode compilation

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

中收到以下错误
@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找不到的东西,我把它改成了我的其中一个sdks,现在我得到了这些奇怪的错误。请任何人帮助我谢谢

编辑:我设法用其他人替换了一些工作人员,现在我有了这个课程:

#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:找不到符号

collect2:ld返回1退出状态

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

1 个答案:

答案 0 :(得分:1)

rootViewController属性在iOS 4.0及更高版本read here

中可用

我的建议:获取最新的SDK