2014-02-15 62 views
0

我與我的想法是在涉及我的兩個班,一個功能我的代碼的微小變化試驗:未找到iOS文件?

-(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' 

儘管有投訴,但在'AvsAViewController'類型的對象上找到屬性currentSpec,並且導入了標頭IS。現在

,如果我註釋掉一行:

-(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' 

我發現有這麼幾種類似的問題,但答案似乎全身是這個地方。我很痛苦地意識到我的調試技巧需要大量的開發,但是有人能給我一些關於這個問題的具體指導嗎?

謝謝!

+0

你嘗試過乾淨嗎? Command-Shift-K – Undo

+0

是的,嘗試了幾次,還嘗試了幾次構建和Xcode重新啓動。只是再次嘗試所有三個。相同的結果。 – rattletrap99

+0

什麼是AvsAViewController.currentSpec中的'AvsAViewController' = [[...'? – Undo

回答

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]; 
} 
+0

好的,這清除了與'AvsAViewController'類型的對象找不到'屬性'currentSpec'「 – rattletrap99

+0

但問題仍然存在重複符號錯誤。 – rattletrap99

+0

我認爲* [這](http://stackoverflow.com/questions/13639411/duplicate-symbols-for-architecture-i386)可能會有所幫助 - 基本上,你需要檢查編譯源在構建階段重複條目。 – Undo

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

只是讀它說什麼。

在AvsAViewController.m中有一個名稱爲_actVsAllButton_tag的符號,在ReportViewController.m中有一個名稱完全相同的符號。

加上六打其他副本。

以下是解決許多問題的提示:不要說「我去了這些錯誤,我不知道爲什麼」。對自己說「我的代碼有錯誤,它是哪個錯誤」?然後你看看錯誤信息並閱讀他們說的話。

+0

我可能應該在答案中提供我的解決方案以及詳細信息,但是我在第一個回覆者的註釋中注意到我發現了一個頭文件導入循環,它佔據了重複的符號。您的建議是相關的和讚賞。謝謝! – rattletrap99