Xcode編譯錯(cuò)誤和警告匯總
1、error: macro names must be identifiers YourProject_prefix.pch
原因: 因?yàn)槟闩K了預(yù)處理器宏,在它處于<Multiple Values>的時(shí)候修改了它
解決方法: Configiration選擇All Configirations,清空它 然后分別重新定義你的Debug,Release,Distributin預(yù)處理器宏吧
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哪個(gè)文件,一般都是從文件系統(tǒng)里刪除文件而沒(méi)有通過(guò)Xcode刪除造成的,Xcode的項(xiàng)目配置文件依然紀(jì)錄著這個(gè)文件的引用
解決辦法: 給文件系統(tǒng)里增加相應(yīng)的文件,或者從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
原因: 簽名錯(cuò)誤
解決辦法: Target -> Get Info -> Build -> Code Signing -> 修改簽名
記得左上角的Configuration類型要跟當(dāng)前Build類型對(duì)應(yīng)(Debug, Release, Distribution),否則改了也白改
5、could not create bundle folder for versioned model *.moda(好像是這個(gè)后綴名的這個(gè)文件)
原因:編譯一次會(huì)產(chǎn)生一個(gè)新的
解決辦法:應(yīng)該把編譯產(chǎn)生出來(lái)的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方法規(guī)則:方法返回id,并且名字以init
出錯(cuò)代碼:- (id) Myinit{
}
解決方法:- (id) initWithMy
{
}