2014-01-11 93 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