一,libxml/HTMLparser.h file not find
第一種方法:
點(diǎn)擊左邊項(xiàng)目的根目錄,再點(diǎn)擊右邊的Build Settings,手工輸入文字:“Header searchpaths”,然后單擊(或雙擊,點(diǎn)擊彈出面板下面的“+”號(hào)進(jìn)行添加)“Header search paths”右邊的空白處,輸入:/usr/include/libxml2
第二種方法:
點(diǎn)擊左邊項(xiàng)目的根目錄,再點(diǎn)擊右邊的Build Settings,手工輸入文字:“Header searchpaths”,然后單擊(或雙擊,點(diǎn)擊彈出面板下面的“+”號(hào)進(jìn)行添加)“ Header search paths”右邊的空白處,輸入:${SDK_DIR}/usr/include/libxml2
二,總是找不到協(xié)議:
第一種方法:沒有引入該協(xié)議,引入該協(xié)議
第二種方法:重復(fù)引入該協(xié)議,重復(fù)引入的地方刪除
三,啟動(dòng)畫面不顯示
1>,圖片大小尺寸必須符合規(guī)定,把所有的圖片導(dǎo)入工程中
2>,進(jìn)入工程Images.xcassets文件夾,把圖片拖入對(duì)應(yīng)的AppIcon,LaungchImage
四,ld: library not found for -lcrypto
clang: error: linker command failed with exit code 1 (use -v to see invocation)
第一種方法:庫(kù)crypto沒有添加進(jìn)Link Binary With Libraries,添加進(jìn)去就OK了
第二種方法:庫(kù)crypto已經(jīng)添加進(jìn)Link Binary With Libraries,把crypto刪除再重新添加進(jìn)去就OK了
五,Unsupported compiler 'com.apple.compilers.llvmgcc42' selected for architecture 'armv7' Xcode 5
Change your compiler for C/C++/ObjectiveC Go to Build Settings->Build OPtions->compiler for C/C++/ObjectiveC; select Default(Apple LLVM5.0)
六,關(guān)于ld: file is universal (2 slices) but does not contain a(n) armv7s slice
升級(jí)了xcode之后,支持iOS6和iphone5,不過Build項(xiàng)目的時(shí)候,出現(xiàn)了標(biāo)題所示錯(cuò)誤提示信息。
原因是引用的第三方庫(kù)導(dǎo)致了這個(gè)鏈接錯(cuò)誤。
解決辦法有三個(gè),隨便哪種都能解決:
1.升級(jí)涉及到的.a文件
2.在target的Build Settings里面,將Build Active Architecture Only改成YES (I choose this)
3.在target的Build Settings里面,找到Valid Architectures,刪除其中的armv7s
所以還是覺得,如果是開源庫(kù),直接把源代碼包含進(jìn)項(xiàng)目比較靠譜。
七,使用第三方插件時(shí),出現(xiàn)contentoffset下移20像素的情況:
解決方案:在使用第三方控件的viewcontroller的viewDidLoad方法中添加下面的代碼即可
if ([self respondsToSelector:@selector(setEdgesForExtendedLayout:)]) {
[self setEdgesForExtendedLayout:UIRectEdgeNone];
}
八,提交app的時(shí)候會(huì)有no indentities were available for signing 提示
1.在Xcode的Organizer 中可以看到你上傳項(xiàng)目的Indetifier
2,在PRovisioning中可以建立的文件和Indetifier保持一致
3,下載你所建立的Provisioning文件,然后雙擊
4,再在Organizer中上傳文件就可以了
5,如果在代碼中作了修改,需要重新打包再上傳,上傳的才會(huì)是最新的代碼
九,no matching provisioning profiles found
1,到Build Settings里面重新選擇進(jìn)入code signing
2,重新選擇profiles
十. mutating method sent to immutable object'
從字面上理解:可變的消息發(fā)給了不可變的對(duì)象。比如NSDictionary類型的對(duì)象調(diào)用setValue方法.應(yīng)該把NSDictionary 改成NSMutableDictionary類型。
十一.Local declaration of 'content' hides instance variable
一般是函數(shù)里面定義的變量和class屬性變量重名了。很少有和系統(tǒng)變量重名的情況
十二.unrecognized selector sent to instance
大部分情況下是因?yàn)閷?duì)象被提前release了,在不希望他release的情況下,指針還在,對(duì)象已經(jīng)不在了
很多時(shí)候,是因?yàn)閕nit初始化函數(shù)中,對(duì)屬性賦值沒有使用self.foo賦值,而是直接對(duì)foo賦值,導(dǎo)致屬性對(duì)象沒有retain(心里以為retain了),而提前釋放。
十三.使用ASIHTTPRequest編譯不通過
原因是一些類庫(kù)沒有加進(jìn)去。把這些庫(kù)加進(jìn)去CFNetwork, SystemConfiguration, MobileCoreServices, and libz.dylib
十四.添加在UIView中的UIButton 單擊不起作用
原因是UIbutton的frame超出了UIView的frame范圍。事實(shí)上UIView并沒有設(shè)置frame,設(shè)置完后( 范圍一定要在UIButton之外),UIButton單擊就可以了
十五.當(dāng)使用presentViewController和dismissPresentViewController時(shí),如果報(bào)這個(gè)錯(cuò) : while presentation is in progress
修改方法為[mainView dismissModalViewControllerAnimated:NO]; 將參數(shù)Animated改為NO;如果報(bào)這個(gè)錯(cuò)while a presentation or dismiss is in progress,試試這樣
if (![[mainView modalViewController] isBeingDismissed]) {
[mainView dismissModalViewControllerAnimated:NO];
}
十六.調(diào)用系統(tǒng)相冊(cè)的時(shí)候,非常容易出現(xiàn)內(nèi)存警告,加入綠色代碼就會(huì)好點(diǎn):
UIImagePickerController * picker = [[UIImagePickerController alloc]init];
picker.delegate = self;
picker.allowsEditing = NO; //是否可編輯
picker.videoQuality=UIImagePickerControllerQualityTypeLow;
//攝像頭
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:picker animated:YES];
[picker release];
十七.ios開發(fā)者都遇見過得錯(cuò)誤:EXC_BAD_access 。這個(gè)和第二個(gè)比較類似。通常的調(diào)試方法就是加入NSZombieEnabled變量,加入方法自行百度。
并且開發(fā)過程中使用[[NSNotificationCenterdefaultCenter]
來發(fā)布本地消息,這個(gè)也經(jīng)常會(huì)出現(xiàn)EXC_BAD_ACCESS錯(cuò)誤。這個(gè)時(shí)候只需要在你的view活著viewControllers的dealloc的方法里面加入
[[NSNotificationCenterdefaultCenter]removeObserver:selfname:@"yourNotification"object:nil];就ok了
十八.遇見一個(gè)蛋疼的問題"linker command failed with exit code 1 (use -v to see invocation)" 。
翻遍了找不到原因。然后還有這樣的警告duplicate symbol _OBJC_CLASS 。原來是在導(dǎo)入某個(gè)類的時(shí)候?qū)?m文件,而不是.h文件
十九:clang failed with exit code 254
檢測(cè)代碼中 是否 有 NSLog 打印了 返回 void 的值.
二十:Verify exit code of build task with internal identifier 'CopyPNGFile 123.png'


一:將出錯(cuò)的png,用PhotoShZ喎?"http://www.2cto.com/kf/ware/vc/" target="_blank" class="keylink">vcNbY0MLXqru70ru0ziwgIMjnuftQaG90b1Nob3C08rK7v6osuMS689e6zqpKcGcgytTK1C4g16q7u8qxLMfryrnTwyA6PHN0cm9uZz605rSizqpXZWK78snosbjL+cq508O1xCYjMjY2ODQ7yr08L3N0cm9uZz4mIzI2Njg0O8q916q7u7PJPHN0cm9uZz4gUE5HLTI0PC9zdHJvbmc+1eLR+bXEzbzGrLTz0KGxyL3Pus/KyjwvcD4KPHA+Cjxicj4KPC9wPgo8cD4KPHN0cm9uZz4zOjwvc3Ryb25nPjwvcD4KPHA+CjxpbWcgc3JjPQ=="http://www.2cto.com/uploadfile/2014/0509/20140509112551421.png" alt="/">
一:確定靜態(tài)庫(kù)中是否有自定義的類文件,如果一個(gè)也沒有,就會(huì)出現(xiàn)這種錯(cuò)誤,這也是為什么新建的靜態(tài)庫(kù)都包含一個(gè)默認(rèn)的類.
二十一: _OBJC_CLASS_$_UIMainKpiXML", referenced from:
1:檢測(cè)類文件是否已經(jīng)指定了Project Target


2:檢測(cè)類文件是否在Bulid Phases 中的 Compile Source 是否包含了這個(gè)類文件


以上兩步都檢查完成以后,如果編譯還報(bào)錯(cuò)誤,請(qǐng)嘗試徹底關(guān)閉XCode 再次編譯試試.
二十二: for architecture armv7s

以下摘自: http://stackoverflow.com/questions/12570116/what-is-the-difference-between-arm7-and-arm7s
Yes you are right about armv7s is about the iPhone 5. Here some summary info I found on the web:
- ARMv6 ISA (used by the ARM11 core in the iPhone 2G and iPhone 3G)
- ARMv7 (used by modern ARM cores, iPhone 3GS, iPhone 4 and 4S)
- ARMv7s (new A6 SoC for iPhone 5).
注:錯(cuò)誤含義表示 指定的framework 不支持對(duì) armv7s 的支持, 也就不支持搭載A6處理器的iPhone 5.
如果在編譯framework或者靜態(tài)庫(kù)的工程中依舊編譯時(shí),可能是以下設(shè)置導(dǎo)致,設(shè)置為NO即可

二十三: Local declaration of "' hides instance variable
私有變量與屬性變量同名所致
二十四:Instance variable '' accessed in class method


1:在靜態(tài)方法不能使用到類的屬性變量,否則就報(bào)上面的錯(cuò)誤
二十五:ld: symbol(s) not found for architecture i386

1:里面意思說:"_stroyboard" 這個(gè)屬性在目標(biāo)類中 根本就沒聲明!

那就聲明一下咯? 注:XCode4.5 會(huì)默認(rèn)聲明了,但是只是針對(duì)自定義類,系統(tǒng)類還沒有. 所以,小心
@synthesize storyboard;
二十六:PerformSelector may cause a leak because its selector is unknow
通過如下代碼解決產(chǎn)生的編譯器警告
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
[self performSelector:nextView];
#pragma clang diagnostic pop
來源:(http://www.ooso.net/archives/620)
二十七:unable to open executable
1:檢測(cè)同一個(gè)靜態(tài)庫(kù)或工程中是否有兩個(gè)或以上的想同類文件存在
2:刪除模擬器中的應(yīng)用,刪除DerivedData文件夾 重新啟動(dòng)XCode.
二十八: Property's synthesized getter follows Cocoa naming convention for returning 'owned' objects
不要在頭文件聲明變量命名是以new copy開頭
參考:http://kongbei888.blog.163.com/blog/static/24326613201261902510652/
二十九:ld: file not found:
1:指向的靜態(tài)庫(kù)沒有找到

三十: _utf8_countTrailBytes
add library libicucore.dylib
三十一:Stray "@" in program
工程使用的編譯器版本過低所致. 修改編譯器版本至最新版本,如下圖:


參考:http://stackoverflow.com/questions/12821938/stray-in-program-with-nsdictionary-definition
三十二.解決真機(jī)調(diào)試iPad Air設(shè)備時(shí)的錯(cuò)誤:architecture not supported的辦法
1.將Build Settings 中Architectures ——> Valid Architectures的arm64刪掉,只留armv7、armv7s
2.同上,將Architectures ——>Architectures改為 $(ARHS_STANDARD)armv7,armv7s
3.把Build Active Architecture Only 改為NO
4.編譯即可
三十三.編譯時(shí)出現(xiàn):Not supported ARM architecture
解決辦法:在./configure 時(shí)加入 -D__ARM_ARCH_5TEJ__
三十四.Couldn"t register xxx.xx.xx with the bootstrap server. Error: unknown error code.
This generally means that another instance of this process was already running or is hung in the debugger.
每個(gè)在xcode下用ios模擬器做開發(fā)的開發(fā)者都應(yīng)該會(huì)遇到過上面所示的錯(cuò)誤,目前找到最行之有效的解決辦法是重啟手機(jī)。不行了也順便把電腦重啟下。 建議以后記得stop就行了 不要正運(yùn)行著就直接卸載了程序
三十五.duplicate symbol _protobuf_c buffer_simple_append in ...錯(cuò)誤解決
選中工程,target,切換到buildsetting標(biāo)簽,定位到other link flag,
輸入: 去除-all_load,即可
三十六.ld: symbol dyld_stub_binding_helper not found, normally in crt1.o/dylib1.o/bundle1.o for architectur
錯(cuò)誤:ld: symbol dyld_stub_binding_helper not found, normally in crt1.o/dylib1.o/bundle1.o for architecture i386
原因:不支持低版本的系統(tǒng)如3.0
解決:Deployment Target was 3.0. Changing it to 4.3 fixed it.
三十七.當(dāng)一個(gè)tableViewCell被選中的時(shí)候,改變一個(gè)button的title,這個(gè)button有背景圖片,改變title不成功
把該button的selected設(shè)為NO
三十八.CUICatalog: Invalid asset name supplied: , or invalid scale factor: 2.000000
這個(gè)提示的意思是說你用了這個(gè)方法
[UIImage imageNamed:name];但是這個(gè)name卻是空的,所以就報(bào)了這個(gè)錯(cuò)了。
解決方法,在項(xiàng)目中搜索[UIImage imageNamed:,然后打印看看所謂的name是否為空。找到后替換。
三十九.XCode開發(fā)遇到的“Could not inspect the application package”解決方案
出現(xiàn)這種情況的原因是:項(xiàng)目里含有 Resources 文件夾。解決方案:
1>在項(xiàng)目里把這個(gè) Resources 文件夾 改為別的名字(不要在項(xiàng)目里改文件夾的名字,這是偽改,要進(jìn)入工程文件夾再改 Resources 名字),再重新引入這個(gè)文件夾
2>按住 option 鍵 ,點(diǎn)擊 Xcode 的product 菜單,選中 Clean Build Folder ,然后確定 clean 就OK了
四十.Xcode has encountered an unexpected error (0xC002)
Xcode has encountered an unexpected error (0xC002)No such file or directory, at ‘/SourceCache/DTDeviceKit/DTDeviceKit-867/DTDeviceKit/DTDeviceKit_Utilities.m:864’解決方法
cd ~/Library/Developer/Xcode/iOS/ DeviceSupport/4.2.1/ /(8C148/)/Symbols/System/Library/Caches/com.apple.dyld/
touch .copied_dyld_shared_cache_armv6
touch .processed_dyld_shared_cache_armv6
touch dyld_shared_cache_armv6
有些可能是
touch .copied_dyld_shared_cache_armv6
touch .processed_dyld_shared_cache_armv6
touch dyld_shared_cache_armv6
四十一.An error was encountered while running(Domain=LaunchSerivcesError, Code=0)
解決方案:重置模擬器
四十二.Undefined symbols for architecture i386:
"_NSFileTypeForHFSTypeCode", referenced from:
-[FMDatabase(FMDatabaseAdditions) applicationIDString] in FMDatabaseAdditions.o
"_NSHFSTypeCodeFromFileType", referenced from:
-[FMDatabase(FMDatabaseAdditions) setApplicationIDString:] in FMDatabaseAdditions.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
解決辦法:把FMDatabase文件刪除了,再重新導(dǎo)入所有的文件
四十三.fatal error: malformed or corrupted AST file: 'Unable to load module "/Users/xxx/Library/Developer/Xcode/DerivedData/ModuleCache/XYZYIE6ZV0OP/Darwin.pcm": file not found' note: after modifying system headers, please delete the module cache at '/Users/me/Library/Developer/Xcode/DerivedData/ModuleCache/XYZYIE6ZV0OP' 1 error generated.
解決辦法:
只需要清除繼承數(shù)據(jù)文件夾即可。具體操作為:進(jìn)入XCode的Window,選擇Organizer->Projects,然后選擇出現(xiàn)問題的 project ,點(diǎn)擊delete button刪除Derived data.
重新編譯項(xiàng)目,即可。
四十四.Command /usr/bin/codesign failed with exit code 1
進(jìn)入xcode 的偏好設(shè)置 -》Account如下圖

點(diǎn)擊第二張圖右下角的刷新按鈕,重新編譯打包,就OK了
四十四.the ipa is invalid.it does not include a payload directory
需要在info-plist 文件中 添加或者修改 LSRequiresIPhoneOS value 為 YES
四十四.iOS9 beta 請(qǐng)求出現(xiàn)App Transport Security has blocked a cleartext HTTP (http://)
錯(cuò)誤描述:
App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app‘s Info.plist file.
在iOS9 beta中,蘋果將原h(huán)ttp協(xié)議改成了https協(xié)議,使用 TLS1.2 SSL加密請(qǐng)求數(shù)據(jù)。
解決方法:
在info.plist 加入key
<key>NSAPPTransportSecurity</key><dict><key>NSAllowsArbitraryLoads</key><true/></dict>