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) Myinit{
}
解決方法:- (id) initWithMy
{
}