我收到此错误: 架构'x86_64'和变体'normal'的OS X部署目标'10 .9'大于OS X 10.8 SDK的最大值'10 .8'。
这是我的代码:
//
// 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
答案 0 :(得分:3)
在Xcode项目中,显示目标的构建设置(通过单击项目导航器中的项目,然后选择目标并单击“构建设置”选项卡)。在“构建设置”搜索框中,键入“Deploy”。它应显示部署设置,其中一个名为“OS X部署目标”。如果您是针对OS X 10.8 SDK构建的,那么应该设置为“OS X 10.8”(或更低)。