Xcode編譯錯誤和警告匯總,xcode編譯匯總

來源:互聯網
上載者:User

Xcode編譯錯誤和警告匯總,xcode編譯匯總

1、error: macro names must be identifiers YourProject_prefix.pch

原因: 因為你弄髒了前置處理器宏,在它處於<Multiple Values>的時候修改了它

解決方案: Configiration選擇All Configirations,清空它 然後分別重新定義你的Debug,Release,Distributin前置處理器宏吧

 

2、warning: no rule to process file '$(PROJECT_DIR)/LoadingView.h' of type sourcecode.c.h for architecture armv6

原因: Target裡Compile Sources裡含有標頭檔 了,那裡面不需要標頭檔

解決方案: 從Target裡Compile Sources裡刪除標頭檔

 

3、Command /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneOS Build System Support.xcplugin/Contents/Resources/copypng failed with exit code 1

原因: png影像檔拷貝失敗,看看資訊上面提示Can't find哪個檔案,一般都是從檔案系統裡刪除檔案而沒有通過Xcode刪除造成的,Xcode的項目設定檔依然紀錄著這個檔案的引用

解決辦法: 給檔案系統裡增加相應的檔案,或者從Xcode的Groups & Files刪除它,或者從Target的Copy Bundle Resources裡刪除它

 

4、Code Sign error: The identity 'iPhone Developer: Your Name' doesn't match any valid certificate/private key pair in the default keychain

原因: 簽名錯誤

解決辦法: Target -> Get Info -> Build -> Code Signing -> 修改簽名

記得左上方的Configuration類型要跟當前Build類型對應(Debug, Release, Distribution),否則改了也白改

 

5、could not create bundle folder for versioned model *.moda(好像是這個尾碼名的這個檔案)

原因:編譯一次會產生一個新的

解決辦法:應該把編譯產生出來的moda檔案都刪了,然後clean下工程,重新build即可

 

6、error:There are no valid certificate/private key pairs in the default keychain

 

7、error:Cannot assign to 'self' outside of a method in the init family

原因:只能在init方法中給self賦值,Xcode判斷是否為init方法規則:方法返回id,並且名字以init     +大寫字母開頭+其他  為準則。例如:- (id) initWithXXX;

出錯代碼:- (id) Myinit{

 self = [super init];

 ……

}

解決方案:- (id) initWithMy

{

 self = [super init];

}

 

8、Storyboards are unavailable on iOS 4.3 and prior

解決辦法:需要清除~/Library/Developer/Xcode/DerivedData中對應當前項目的檔案夾,然後重新編譯就沒問題了,這應該是Xcode4.5.1的一個bug。

 

9、Application windows are expected to have a root view controller at the end of application launch

解決方案:在ios5以上版本,應用程式載入時,需要一個 root view controller ,所以需要編寫代碼

_rootViewController = [[RootViewController alloc] init];

self.window.rootViewController = _rootViewController;

 

10、error: failed to attach to process ID 0

解決方案:

1)delete the App directy under ~/Library/Developer/Xcode/DerivedData

2) start Xcode, in the menubar Project -> Clean

 

歡迎園子裡的碼農們   樓下補充\(^o^)/~

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.