找不到iOS文件?

时间:2014-02-15 02:01:10

标签: ios debugging

我正在尝试我的代码中的一个小改动,涉及我的两个类和一个函数:

-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    AvsAViewController.currentSpec = [[SearchSpecs alloc]init];

    [sender setEnabled:NO];
}

现在,构建失败,我得到三个错误

1) Property 'currentSpec' not found on object of type 'AvsAViewController'


2) Ld /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Products/Debug-iphonesimulator/WMDGx.app/WMDGx normal i386
    cd "/Users/timjones/Desktop/WMDG project/WMDGx"
    setenv IPHONEOS_DEPLOYMENT_TARGET 7.0
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Products/Debug-iphonesimulator -F/Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Products/Debug-iphonesimulator -filelist /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Intermediates/WMDGx.build/Debug-iphonesimulator/WMDGx.build/Objects-normal/i386/WMDGx.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.0 -framework QuartzCore -framework CoreData -framework CoreGraphics -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Intermediates/WMDGx.build/Debug-iphonesimulator/WMDGx.build/Objects-normal/i386/WMDGx_dependency_info.dat -o /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Products/Debug-iphonesimulator/WMDGx.app/WMDGx

ld: file not found: /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Intermediates/WMDGx.build/Debug-iphonesimulator/WMDGx.build/Objects-normal/i386/ReportViewController.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)


3) GenerateDSYMFile /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Products/Debug-iphonesimulator/WMDGx.app.dSYM /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Products/Debug-iphonesimulator/WMDGx.app/WMDGx
    cd "/Users/timjones/Desktop/WMDG project/WMDGx"
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Products/Debug-iphonesimulator/WMDGx.app/WMDGx -o /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Products/Debug-iphonesimulator/WMDGx.app.dSYM

error: unable to open executable '/Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Products/Debug-iphonesimulator/WMDGx.app/WMDGx'

尽管存在投诉,但在currentSpec类型的对象上找到了属性'AvsAViewController',并且导入了标题。

现在,如果我注释掉一行:

-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
//    AvsAViewController.currentSpec = [[SearchSpecs alloc]init];

    [sender setEnabled:NO];
}

我收到两个错误:

1) Ld /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Products/Debug-iphonesimulator/WMDGx.app/WMDGx normal i386
    cd "/Users/timjones/Desktop/Where'd My Day Go project/WMDGx"
    setenv IPHONEOS_DEPLOYMENT_TARGET 7.0
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Products/Debug-iphonesimulator -F/Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Products/Debug-iphonesimulator -filelist /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Intermediates/WMDGx.build/Debug-iphonesimulator/WMDGx.build/Objects-normal/i386/WMDGx.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.0 -framework QuartzCore -framework CoreData -framework CoreGraphics -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Intermediates/WMDGx.build/Debug-iphonesimulator/WMDGx.build/Objects-normal/i386/WMDGx_dependency_info.dat -o /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Products/Debug-iphonesimulator/WMDGx.app/WMDGx

duplicate symbol _aVsAButton_tag in:
    /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Intermediates/WMDGx.build/Debug-iphonesimulator/WMDGx.build/Objects-normal/i386/AvsAViewController.o
    /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Intermediates/WMDGx.build/Debug-iphonesimulator/WMDGx.build/Objects-normal/i386/ReportViewController.o
duplicate symbol _cVsCButton_tag in:
    /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Intermediates/WMDGx.build/Debug-iphonesimulator/WMDGx.build/Objects-normal/i386/AvsAViewController.o
    /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Intermediates/WMDGx.build/Debug-iphonesimulator/WMDGx.build/Objects-normal/i386/ReportViewController.o
duplicate symbol _actVsAllButton_tag in:
    /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Intermediates/WMDGx.build/Debug-iphonesimulator/WMDGx.build/Objects-normal/i386/AvsAViewController.o
    /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Intermediates/WMDGx.build/Debug-iphonesimulator/WMDGx.build/Objects-normal/i386/ReportViewController.o
duplicate symbol _catVsAllButton_tag in:
    /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Intermediates/WMDGx.build/Debug-iphonesimulator/WMDGx.build/Objects-normal/i386/AvsAViewController.o
    /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Intermediates/WMDGx.build/Debug-iphonesimulator/WMDGx.build/Objects-normal/i386/ReportViewController.o
duplicate symbol _customDatePickerButton_tag in:
    /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Intermediates/WMDGx.build/Debug-iphonesimulator/WMDGx.build/Objects-normal/i386/AvsAViewController.o
    /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Intermediates/WMDGx.build/Debug-iphonesimulator/WMDGx.build/Objects-normal/i386/ReportViewController.o
duplicate symbol _goButton_tag in:
    /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Intermediates/WMDGx.build/Debug-iphonesimulator/WMDGx.build/Objects-normal/i386/AvsAViewController.o
    /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Intermediates/WMDGx.build/Debug-iphonesimulator/WMDGx.build/Objects-normal/i386/ReportViewController.o
ld: 6 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)


2) ld: 6 duplicate symbols for architecture i386


clang: error: linker command failed with exit code 1 (use -v to see invocation)


GenerateDSYMFile /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Products/Debug-iphonesimulator/WMDGx.app.dSYM /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Products/Debug-iphonesimulator/WMDGx.app/WMDGx
    cd "/Users/timjones/Desktop/Where'd My Day Go project/WMDGx"
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Products/Debug-iphonesimulator/WMDGx.app/WMDGx -o /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Products/Debug-iphonesimulator/WMDGx.app.dSYM

error: unable to open executable '/Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Products/Debug-iphonesimulator/WMDGx.app/WMDGx'

我在SO上发现了几个类似的问题,但答案似乎到处都是。我很痛苦地意识到我的调试技巧需要大量的开发,但有人可以就这个特殊问题给我一些具体的指导吗?

谢谢!

2 个答案:

答案 0 :(得分:0)

如您所知,此代码是问题所在:

-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    AvsAViewController.currentSpec = [[SearchSpecs alloc]init];

    [sender setEnabled:NO];
}

就是这一行:

AvsAViewController.currentSpec = [[SearchSpecs alloc]init];

当您只能在实例上设置属性时,您尝试在类上设置属性。您想要的是UIStoryboardSegue上的destinationViewController属性。您可能希望代码看起来像这样:

-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    segue.destinationViewController.currentSpec = [[SearchSpecs alloc]init];

    [sender setEnabled:NO];
}

如果Xcode抱怨未找到属性,您可能需要使用强制转换来告诉编译器因为您知道自己在做什么而关闭:

-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    [(AvsAViewController *)segue.destinationViewController setCurrentSpec:[[SearchSpecs alloc]init]];

    [sender setEnabled:NO];
}

答案 1 :(得分:0)

这是你的链接器错误。

重复符号 _actVsAllButton_tag :     /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Intermediates/WMDGx.build/Debug-iphonesimulator/WMDGx.build/Objects-normal/i386/的 AvsAViewController.o     /Users/timjones/Library/Developer/Xcode/DerivedData/WMDGx-dixcfloqnhryzreowrpbowempliz/Build/Intermediates/WMDGx.build/Debug-iphonesimulator/WMDGx.build/Objects-normal/i386/的 ReportViewController.o < / p>

请阅读它的内容。

在AvsAViewController.m中有一个名为_actVsAllButton_tag的符号,在ReportViewController.m中有一个完全相同名称的符号。

另外还有其他六个副本。

这是解决许多问题的一个提示:不要说“我去了这些错误,我不知道为什么”。对自己说“我的代码中有错误。它出现了哪个错误”?然后,您查看错误消息并阅读他们所说的内容。