2014-01-11 72 views
2

我得到此错误: 架构'x86_64'和变体'normal'的OS X部署目标'10 .9'大于OS X 10.8 SDK的最大值'10.8'。依赖关系分析警告 - XCODE 5

这里是我的代码:

// 
// AppDelegate.m 
// IMG Viewer 
// 
// Created by Jeremy Irvine on 11/01/2014. 
// Copyright (c) 2014 Jezza23 inc. All rights reserved. 
// 

#import "AppDelegate.h" 

@implementation AppDelegate 

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification 
{ 

} 

- (IBAction)OpenImage:(id)sender { 
    NSOpenPanel *ImageOpener = [NSOpenPanel openPanel]; 
    [ImageOpener runModal]; 
    NSURL *imagePath = [ImageOpener URL]; 
    NSImage *image = [[NSImage alloc] initWithContentsOfURL:imagePath]; 

    [_ImageWindow setImage:image]; 
} 
@end 

而且AppDelegate.h:

// 
// AppDelegate.h 
// IMG Viewer 
// 
// Created by Jeremy Irvine on 11/01/2014. 
// Copyright (c) 2014 Jezza23 inc. All rights reserved. 
// 

#import <Cocoa/Cocoa.h> 

@interface AppDelegate : NSObject <NSApplicationDelegate> 

@property (assign) IBOutlet NSWindow *window; 
@property (weak) IBOutlet NSImageView *ImageWindow; 
- (IBAction)OpenImage:(id)sender; 

@end 
+1

检查您的应用程序目标的构建设置,并确保您正在构建正确的操作系统版本并编译x86 CPU。看起来你的代码不是问题。 – Zarathuztra

回答

2

在Xcode项目,显示你的目标生成设置(通过单击项目在项目导航,然后选择Target并点击“Build Settings”选项卡)。在“生成设置”搜索框中,键入“部署”。它应该显示部署设置,其中一个名为“OS X部署目标”。如果您针对OS X 10.8 SDK进行构建,则应将其设置为“OS X 10.8”(或更低)。

+0

你是圣人!谢谢。 – Patricia