为什么我在这个简单的代码中得到Apple Mach-O错误



我有一个非常简单的代码,但不知怎么的,我在这上面得到了一个Apple Mach-O错误。有人能告诉我出了什么问题吗?

AvhorViewController.h:

#import <UIKit/UIKit.h>
@interface AvhorViewController : UIViewController
@property (strong, nonatomic) IBOutlet UIWebView *WebViewAvhor;
@end

AvhorViewController.m

#import "AvhorViewController.h"
@interface AvhorViewController ()
@end
@implementation AvhorViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
    }
    return self;
}
- (void)viewDidLoad
{
    [super viewDidLoad];
    NSString *path = [[NSBundle mainBundle] pathForResource:@"one" ofType:@"htm" inDirectory:@"Avhor"];
    NSURL *url = [NSURL fileURLWithPath:path];
    NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
    [_WebViewAvhor loadRequest:requestObj];
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
}
@end

我添加了以下框架:

AddressBookUI.framework
MapKit.framework
CoreLocation.framework
UIKit.framework
Foundation.framework
CoreGraphics.framework

错误的实质:

Ld/用户/Centurion/Library/Developer/Xcode/DerivedData/Avhor clfeavlkecrxomdmbtixetebjsa/Build/Products/Debug-iphoneimulator/Avhor.app/Avhor正常i386cd/用户/Centurion/文档/Xcode/Avhorsetenv IPHONEOS_DEPLOYMENT_TARGET 6.1setenv PATH"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.Platforms/Developer//usr/bin:/Applications/Xcode/app/Contents/Developer/usr/bin:/usr/bin:/usr/sbin:/sbin"/应用程序/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang-arch i386-isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator 6.1.sdk-L/Users/Centurion/Library/Developer/Xcode/DerivedData/Avhor clfeavlkecrxomdbtwixetebjsa/Build/Products/Debug iphonesimulator-F/Users/Centurion/Library/Developer/Xcode/DerivedData/Avhor clfeavlkecrxomdbtwixetebjsa/Build/Products/Debug iphonesimulator-filelist/Users/Centurion/Library/Developer/Xcode/DerivedData/Avhor clfeavlkecrxomdbtwixetebjsa/Build/Inmediates/Avhor.Build/Debug-iphoneimulator/Avhor.Build/Objects-normal/i386/Avhor.LinkFileList-Xlinker-objc_abi_version-Xlinker 2-fobjc arc-fobj link运行时-Xlinker-no_implicit_dylibs-mios模拟器版本min=6.1-framework AddressBookUI-framework MapKit-framework CoreLocation-framework UIKit-frameworkFoundation-framework Core Graphics-o/用户/Centurion/Library/Developer/Xcode/DerivedData/Avhor clfeavlkecrxomdmbtixetebjsa/Build/Products/Debug-iphoneimulator/Avhor.app/Avhor

ld:无法打开要写入的输出文件:/Users/Centurion/Library/Developer/Xcode/DerivedData/Avhor clfeavlkecrxomdbtwixetebjsa/Build/Products/Debug iphonesimulator/Avhor.app/Avhor,体系结构i386 clang的errno=21:错误:链接器命令失败退出代码为1(使用-v查看调用)

请参阅此处了解相同的问题。你可以尝试什么(通常的Xcode步骤来解决问题):

  • 手动删除错误消息中的文件
  • 清洁项目
  • 重新打开Xcode

错误是因为我将保存本地内容的文件夹命名为与项目名称相同。

我做了以下事情:

  • 已删除包含本地内容的文件夹(在Finder中
  • 已清理项目
  • 添加了具有不同名称的文件夹中的文件

相关内容

最新更新