一,libxml/HTMLparser.h file not find
第一種方法:
點擊左邊項目的根目錄,再點擊右邊的Build Settings,手工輸入文字:“Header search paths”,然后單擊(或雙擊,點擊彈出面板下面的“+”號進行添加)“Header search paths ”右邊的空白處,輸入:/usr/include/libxml2
第二種方法:
點擊左邊項目的根目錄,再點擊右邊的Build Settings,手工輸入文字:“Header search paths”,然后單擊(或雙擊,點擊彈出面板下面的“+”號進行添加)“ Header search paths ”右邊的空白處,輸入:${SDK_DIR}/usr/include/libxml2
二,總是找不到協議:
第一種方法:沒有引入該協議,引入該協議
第二種方法:重復引入該協議,重復引入的地方刪除
三,啟動畫面不顯示
1>,圖片大小尺寸必須符合規定,把所有的圖片導入工程中
2>,進入工程Images.xcassets文件夾,把圖片拖入對應的AppIcon,LaungchImage
四,ld: library not found for -lcrypto
clang: error: linker command failed with exit code 1 (use -v to see invocation)
第一種方法:庫crypto沒有添加進Link Binary With Libraries,添加進去就OK了
第二種方法:庫crypto已經添加進Link Binary With Libraries,把crypto刪除再重新添加進去就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)
六,關於ld: file is universal (2 slices) but does not contain a(n) armv7s slice
升級了xcode之后,支持iOS6和iPhone5,不過Build項目的時候,出現了標題所示錯誤提示信息。
原因是引用的第三方庫導致了這個鏈接錯誤。
解決辦法有三個,隨便哪種都能解決:
1.升級涉及到的.a文件
2.在target的Build Settings里面,將Build Active Architecture Only改成YES (I choose this)
3.在target的Build Settings里面,找到Valid Architectures,刪除其中的armv7s
所以還是覺得,如果是開源庫,直接把源代碼包含進項目比較靠譜。
七,使用第三方插件時,出現contentoffset下移20像素的情況:
解決方案:在使用第三方控件的viewcontroller的viewDidLoad方法中添加下面的代碼即可
if ([self respondsToSelector:@selector(setEdgesForExtendedLayout:)]) {
[self setEdgesForExtendedLayout:UIRectEdgeNone];
}
八,提交app的時候會有no indentities were available for signing 提示
1.在Xcode的Organizer 中可以看到你上傳項目的Indetifier
2,在Provisioning中可以建立的文件和Indetifier保持一致
3,下載你所建立的Provisioning文件,然后雙擊
4,再在Organizer中上傳文件就可以了
5,如果在代碼中作了修改,需要重新打包再上傳,上傳的才會是最新的代碼
九,no matching provisioning profiles found
1,到Build Settings里面重新選擇進入code signing
2,重新選擇profiles
十. mutating method sent to immutable object'
從字面上理解:可變的消息發給了不可變的對象。比如NSDictionary類型的對象調用setValue方法.應該把NSDictionary 改成NSMutableDictionary類型。
十一.Local declaration of 'content' hides instance variable
一般是函數里面定義的變量和class屬性變量重名了。很少有和系統變量重名的情況
十二.unrecognized selector sent to instance
大部分情況下是因為對象被提前release了,在不希望他release的情況下,指針還在,對象已經不在了
很多時候,是因為init初始化函數中,對屬性賦值沒有使用self.foo賦值,而是直接對foo賦值,導致屬性對象沒有retain(心里以為retain了),而提前釋放。
十三.使用ASIHTTPRequest編譯不通過
原因是一些類庫沒有加進去。把這些庫加進去CFNetwork, SystemConfiguration, MobileCoreServices, and libz.dylib
十四.添加在UIView中的UIButton 單擊不起作用
原因是UIbutton的frame超出了UIView的frame范圍。事實上UIView並沒有設置frame,設置完后( 范圍一定要在UIButton之外),UIButton單擊就可以了
十五.當使用presentViewController和dismissPresentViewController時,如果報這個錯 : while presentation is in progress
修改方法為[mainView dismissModalViewControllerAnimated:NO]; 將參數Animated改為NO;如果報這個錯while a presentation or dismiss is in progress,試試這樣
if (![[mainView modalViewController] isBeingDismissed]) {
[mainView dismissModalViewControllerAnimated:NO];
}
十六.調用系統相冊的時候,非常容易出現內存警告,加入綠色代碼就會好點:
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開發者都遇見過得錯誤:EXC_BAD_ACCESS 。這個和第二個比較類似。通常的調試方法就是加入NSZombieEnabled變量,加入方法自行百度。
並且開發過程中使用[[NSNotificationCenterdefaultCenter]
來發布本地消息,這個也經常會出現EXC_BAD_ACCESS錯誤。這個時候只需要在你的view活着viewControllers的dealloc的方法里面加入
[[NSNotificationCenterdefaultCenter]removeObserver:selfname:@"yourNotification"object:nil];就ok了
十八.遇見一個蛋疼的問題"linker command failed with exit code 1 (use -v to see invocation)" 。
翻遍了找不到原因。然后還有這樣的警告duplicate symbol _OBJC_CLASS 。原來是在導入某個類的時候導入.m文件,而不是.h文件
十九:clang failed with exit code 254
檢測代碼中 是否 有 NSLog 打印了 返回 void 的值.
二十:Verify exit code of build task with internal identifier 'CopyPNGFile 123.png'
一:將出錯的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="\">
一:確定靜態庫中是否有自定義的類文件,如果一個也沒有,就會出現這種錯誤,這也是為什么新建的靜態庫都包含一個默認的類.
二十一: _OBJC_CLASS_$_UIMainKpiXML", referenced from:
1:檢測類文件是否已經指定了Project Target
2:檢測類文件是否在Bulid Phases 中的 Compile Source 是否包含了這個類文件
以上兩步都檢查完成以后,如果編譯還報錯誤,請嘗試徹底關閉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).
注:錯誤含義表示 指定的framework 不支持對 armv7s 的支持, 也就不支持搭載A6處理器的iPhone 5.
如果在編譯framework或者靜態庫的工程中依舊編譯時,可能是以下設置導致,設置為NO即可
二十三: Local declaration of "' hides instance variable
私有變量與屬性變量同名所致
二十四:Instance variable '' accessed in class method
1:在靜態方法不能使用到類的屬性變量,否則就報上面的錯誤
二十五:ld: symbol(s) not found for architecture i386
1:里面意思說:"_stroyboard" 這個屬性在目標類中 根本就沒聲明!
那就聲明一下咯? 注:XCode4.5 會默認聲明了,但是只是針對自定義類,系統類還沒有. 所以,小心
@synthesize storyboard;
二十六:PerformSelector may cause a leak because its selector is unknow
通過如下代碼解決產生的編譯器警告
#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:檢測同一個靜態庫或工程中是否有兩個或以上的想同類文件存在
2:刪除模擬器中的應用,刪除DerivedData文件夾 重新啟動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:指向的靜態庫沒有找到
三十: _utf8_countTrailBytes
add library libicucore.dylib
三十一:Stray "@" in program
工程使用的編譯器版本過低所致. 修改編譯器版本至最新版本,如下圖:
參考:http://stackoverflow.com/questions/12821938/stray-in-program-with-nsdictionary-definition
三十二.解決真機調試iPad Air設備時的錯誤: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.編譯即可
三十三.編譯時出現:Not supported ARM architecture
解決辦法:在./configure 時加入 -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.
每個在xcode下用ios模擬器做開發的開發者都應該會遇到過上面所示的錯誤,目前找到最行之有效的解決辦法是重啟手機。不行了也順便把電腦重啟下。 建議以后記得stop就行了 不要正運行着就直接卸載了程序
三十五.duplicate symbol _protobuf_c buffer_simple_append in ...錯誤解決
選中工程,target,切換到buildsetting標簽,定位到other link flag,
輸入: 去除-all_load,即可
三十六.ld: symbol dyld_stub_binding_helper not found, normally in crt1.o/dylib1.o/bundle1.o for architectur
錯誤:ld: symbol dyld_stub_binding_helper not found, normally in crt1.o/dylib1.o/bundle1.o for architecture i386
原因:不支持低版本的系統如3.0
解決:Deployment Target was 3.0. Changing it to 4.3 fixed it.
三十七.當一個tableViewCell被選中的時候,改變一個button的title,這個button有背景圖片,改變title不成功
把該button的selected設為NO
三十八.CUICatalog: Invalid asset name supplied: , or invalid scale factor: 2.000000
這個提示的意思是說你用了這個方法
[UIImage imageNamed:name];但是這個name卻是空的,所以就報了這個錯了。
解決方法,在項目中搜索[UIImage imageNamed:,然后打印看看所謂的name是否為空。找到后替換。
三十九.XCode開發遇到的“Could not inspect the application package”解決方案
出現這種情況的原因是:項目里含有 Resources 文件夾。解決方案:
1>在項目里把這個 Resources 文件夾 改為別的名字(不要在項目里改文件夾的名字,這是偽改,要進入工程文件夾再改 Resources 名字),再重新引入這個文件夾
2>按住 option 鍵 ,點擊 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 .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文件刪除了,再重新導入所有的文件
四十三.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.
只需要清除繼承數據文件夾即可。具體操作為:進入XCode的Window,選擇Organizer->Projects,然后選擇出現問題的 project ,點擊delete button刪除Derived data.
重新編譯項目,即可。
四十四.Command /usr/bin/codesign failed with exit code 1
進入xcode 的偏好設置 -》Account如下圖
點擊第二張圖右下角的刷新按鈕,重新編譯打包,就OK了
四十四.the ipa is invalid.it does not include a payload directory
需要在info-plist 文件中 添加或者修改 LSRequiresIPhoneOS value 為 YES
四十四.iOS9 beta 請求出現App Transport Security has blocked a cleartext HTTP (http://)
錯誤描述:
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中,蘋果將原http協議改成了https協議,使用 TLS1.2 SSL加密請求數據。
解決方法:
在info.plist 加入key
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
四十五.Could not find Developer Disk Image
真機系統太高,Xcode支持不到這個系統,要有這個系統版本的鏡像文件 ,/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport ,會列出支持的設備,然后在網上下載對應的文件
四十六.UICollectionView 會在APP再次打開時下沉64像素
方案一:在Storyboard中取消勾選Controller的Adjust Scroll View Insets。或者
self.automaticallyAdjustsScrollViewInsets = NO;
方案二:
self.edgesForExtendedLayout = UIRectEdgeNone;
四十六.dyld: Library not loaded: @rpath/libswiftAVFoundation.dylib
Referenced from: /var/mobile/Containers/Bundle/Application/AC4B5FD7-43B3-4743-9682-60A026C5CAE2/NewFoodiPad.app/NewFoodiPad
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf ~/Library/Caches/com.apple.dt.Xcode
四十七.swift項目 ios8系統 SVProgressHud crash在 self.hudView.motionEffects = @[];
self.hudView.motionEffects = [NSArray array];
四十八.swift項目 ios8 dyld: Symbol not found: ___NSArray0__
dyld: Symbol not found: ___NSArray0__ Referenced from: /private/var/mobile/Containers/Bundle/Application/5C6F5D69-5D14-4C07-BEA4-F410C18C66CC/DGBao.app/DGBao Expected in: /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /private/var/mobile/Containers/Bundle/Application/5C6F5D69-5D14-4C07-BEA4-F410C18C66CC/DGBao.app/DGBao
解決辦法:
改為 optinal
四十九.The maximum number of apps for free development profiles has been reached.
免費應用程序調試最大限度
蘋果免費App ID只能運行2個應用程序,當調試第三個的時候就會報這個錯誤,我們必須把之前的應用程序刪除,就可以調試新的了
五十.“(null)” is of a model that is not supported by this version of Xcode.
今天真機運行碰見了這個問題(“(null)” is of a model that is not supported by this version of Xcode. Ple),發現將XCode重啟后就可以真機運行了,碰見這個問題的朋友可以試下