简体   繁体   中英

iphone compilation between different xcode versions?

Hi I am just starting to develop Iphone apps, it's my first day. And I have to use some code a colleague gave me (he has xcode 4.1 or 4.2) l just to quickly try it out but It doesn't compile and I don't understand why. I have iphone SDK 3.1 and xcode 3.2 (i think). Updating to any other version is out of the question so is there a way I could fix these compilation errors? I get the following errors in 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;
}

When I opened the project i tried to compile and it said something about iphoneos not found and the I had it changed to one of the sdks I have and now i get these weird errors. Please anybody help me thanks

EDIT: I managed to replace some staff by other and now I have this class:

#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

but I have another compilation errors now and ones I don't even understand:

"__Block_object_dispose", referenced from:

  ___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", referenced from:

  ___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", referenced from:

  __NSConcreteStackBlock$non_lazy_ptr in iLikeItViewController.o


 (maybe you meant: __NSConcreteStackBlock$non_lazy_ptr)

ld: symbol(s) not found

collect2: ld returned 1 exit status

Could anybody help plz I need to learn these basics steps to transform xcode 4 projetcs into 3 because I have snow Leopard and that's the latest version the system lets me install.

rootViewController property is available in iOS 4.0 and later , read here

My advice : get newest SDK

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM