一扣草,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
二,總是找不到協(xié)議:
第一種方法:沒有引入該協(xié)議僧家,引入該協(xié)議
第二種方法:重復(fù)引入該協(xié)議雀摘,重復(fù)引入的地方刪除
三,啟動畫面不顯示
- 1啸臀、圖片大小尺寸必須符合規(guī)定届宠,把所有的圖片導(dǎo)入工程中
- 2、進入工程Images.xcassets文件夾乘粒,把圖片拖入對應(yīng)的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已經(jīng)添加進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)
六轧铁,關(guān)于ld: file is universal (2 slices) but does not contain a(n) armv7s slice
升級了xcode之后,支持iOS6和iPhone5旦棉,不過Build項目的時候齿风,出現(xiàn)了標(biāo)題所示錯誤提示信息。
原因是引用的第三方庫導(dǎo)致了這個鏈接錯誤绑洛。
解決辦法有三個救斑,隨便哪種都能解決:
- 1.升級涉及到的.a文件
- 2.在target的Build Settings里面,將Build Active Architecture Only改成YES (I choose this)
- 3.在target的Build Settings里面真屯,找到Valid Architectures脸候,刪除其中的armv7s
所以還是覺得,如果是開源庫绑蔫,直接把源代碼包含進項目比較靠譜运沦。
七,使用第三方插件時配深,出現(xiàn)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'
從字面上理解:可變的消息發(fā)給了不可變的對象幸斥。比如NSDictionary類型的對象調(diào)用setValue方法.應(yīng)該把NSDictionary 改成NSMutableDictionary類型。
十一咬扇,Local declaration of 'content' hides instance variable
一般是函數(shù)里面定義的變量和class屬性變量重名了甲葬。很少有和系統(tǒng)變量重名的情況
十二,unrecognized selector sent to instance
大部分情況下是因為對象被提前release了懈贺,在不希望他release的情況下经窖,指針還在,對象已經(jīng)不在了梭灿。
很多時候画侣,是因為init初始化函數(shù)中,對屬性賦值沒有使用self.foo賦值堡妒,而是直接對foo賦值配乱,導(dǎo)致屬性對象沒有retain(心里以為retain了),而提前釋放皮迟。
十三搬泥,使用ASIHTTPRequest編譯不通過
原因是一些類庫沒有加進去。把這些庫加進去CFNetwork, SystemConfiguration, MobileCoreServices, and libz.dylib
十四伏尼,添加在UIView中的UIButton 單擊不起作用
原因是UIbutton的frame超出了UIView的frame范圍忿檩。事實上UIView并沒有設(shè)置frame,設(shè)置完后( 范圍一定要在UIButton之外)爆阶,UIButton單擊就可以了
十五休溶,當(dāng)使用presentViewController和dismissPresentViewController時,如果報這個錯 : while presentation is in progress
修改方法為[mainView dismissModalViewControllerAnimated:NO]; 將參數(shù)Animated改為NO扰她;如果報這個錯while a presentation or dismiss is in progress,試試這樣
if (![[mainView modalViewController] isBeingDismissed]) {
[mainView dismissModalViewControllerAnimated:NO];
}
十六芭碍,調(diào)用系統(tǒng)相冊的時候徒役,非常容易出現(xiàn)內(nèi)存警告,加入綠色代碼就會好點:
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ā)者都遇見過得錯誤:EXC_BAD_ACCESS 忧勿。這個和第二個比較類似杉女。通常的調(diào)試方法就是加入NSZombieEnabled變量,加入方法自行百度鸳吸。
并且開發(fā)過程中使用[[NSNotificationCenterdefaultCenter]
來發(fā)布本地消息熏挎,這個也經(jīng)常會出現(xiàn)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 养匈。原來是在導(dǎo)入某個類的時候?qū)?m文件哼勇,而不是.h文件
十九,clang failed with exit code 254
檢測代碼中 是否 有 NSLog 打印了 返回 void 的值.
二十呕乎,Verify exit code of build task with internal identifier 'CopyPNGFile 123.png'
一:確定靜態(tài)庫中是否有自定義的類文件,如果一個也沒有,就會出現(xiàn)這種錯誤,這也是為什么新建的靜態(tài)庫都包含一個默認的類.
二十一积担, OBJC_CLASS$_UIMainKpiXML", referenced from:
- 1、檢測類文件是否已經(jīng)指定了Project Target
- 2猬仁、檢測類文件是否在Bulid Phases中的Compile Source是否包含了這個類文件
以上兩步都檢查完成以后,如果編譯還報錯誤,請嘗試徹底關(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).
注:錯誤含義表示 指定的framework 不支持對 armv7s 的支持, 也就不支持搭載A6處理器的iPhone 5.
如果在編譯framework或者靜態(tài)庫的工程中依舊編譯時,可能是以下設(shè)置導(dǎo)致,設(shè)置為NO即可
二十三、 Local declaration of "' hides instance variable
私有變量與屬性變量同名所致
二十四湿刽,Instance variable '' accessed in class method
在靜態(tài)方法不能使用到類的屬性變量,否則就報上面的錯誤
二十五的烁,ld: symbol(s) not found for architecture i386
1:里面意思說:"_stroyboard" 這個屬性在目標(biāo)類中 根本就沒聲明!
那就聲明一下咯? 注:XCode4.5 會默認聲明了,但是只是針對自定義類,系統(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撮躁、檢測同一個靜態(tài)庫或工程中是否有兩個或以上的想同類文件存在
- 2、刪除模擬器中的應(yīng)用,刪除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:
指向的靜態(tài)庫沒有找到
三十,_utf8_countTrailBytes
add library libicucore.dylib
三十一漓穿,Stray "@" in program
工程使用的編譯器版本過低所致. 修改編譯器版本至最新版本,如下圖:
參考:http://stackoverflow.com/questions/12821938/stray-in-program-with-nsdictionary-definition
三十二嗤军,解決真機調(diào)試iPad Air設(shè)備時的錯誤:architecture not supported的辦法
1、將Build Settings 中Architectures ——> Valid Architectures的arm64刪掉晃危,只留armv7叙赚、armv7s
2、同上僚饭,將Architectures ——>Architectures改為 $(ARHS_STANDARD)armv7震叮,armv7s
3、把Build ActiveArchitectureOnly 改為NO
4鳍鸵、編譯即可
三十三苇瓣,編譯時出現(xiàn):Not supported ARMarchitecture
解決辦法:在./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模擬器做開發(fā)的開發(fā)者都應(yīng)該會遇到過上面所示的錯誤偿乖,目前找到最行之有效的解決辦法是重啟手機击罪。不行了也順便把電腦重啟下哲嘲。 建議以后記得stop就行了 不要正運行著就直接卸載了程序
三十五,duplicate symbol _protobuf_c buffer_simple_append in ...錯誤解決*
選中工程媳禁,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
錯誤: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)一個tableViewCell被選中的時候丧枪,改變一個button的title,這個button有背景圖片光涂,改變title不成功
把該button的selected設(shè)為NO
三十八,CUICatalog: Invalid asset name supplied: , or invalid scale factor: 2.000000
這個提示的意思是說你用了這個方法
[UIImageimageNamed:name];但是這個name卻是空的拧烦,所以就報了這個錯了忘闻。
解決方法,在項目中搜索[UIImageimageNamed:,然后打印看看所謂的name是否為空恋博。找到后替換齐佳。
三十九,XCode開發(fā)遇到的“Could not inspect the application package”解決方案
出現(xiàn)這種情況的原因是:項目里含有 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 .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.old: symbol(s) not found for architecture i386clang: 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ù)文件夾即可近顷。具體操作為:進入XCode的Window生音,選擇Organizer->Projects,然后選擇出現(xiàn)問題的 project 窒升,點擊delete button刪除Derived data.
重新編譯項目缀遍,即可。
四十四.Command /usr/bin/codesign failed with exit code 1
進入xcode 的偏好設(shè)置 -》Account如下圖
點擊第二張圖右下角的刷新按鈕饱须,重新編譯打包瑟由,就OK了
四十四,the ipa is invalid.it does not include a payload directory
需要在info-plist 文件中 添加或者修改 LSRequiresIPhoneOS value 為 YES
四十四,iOS9 beta 請求出現(xiàn)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](http://cpro.baidu.com/cpro/ui/uijs.php?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=18&is_app=0&jk=9ccb05e369458d2f&k=app&k0=app&kdi0=0&luki=5&n=10&p=baidu&q=65035100_cpr&rb=0&rs=1&seller_id=1&sid=2f8d4569e305cb9c&ssp2=1&stid=0&t=tpclicked3_hc&td=1836545&tu=u1836545&u=http%3A%2F%2Fwww%2Ebubuko%2Ecom%2Finfodetail%2D936912%2Ehtml&urlid=0)‘s Info.plist file.
在iOS9beta中歹苦,蘋果將原h(huán)ttp協(xié)議改成了https協(xié)議,使用 TLS1.2 SSL加密請求數(shù)據(jù)督怜。
解決方法:
在info.plist 加入key
NSAppTransportSecurity
NSAllowsArbitraryLoads
四十五殴瘦,Could not find Developer Disk Image
真機系統(tǒng)太高厦凤,Xcode支持不到這個系統(tǒng)锄禽,要有這個系統(tǒng)版本的鏡像文件 慕趴,/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport ,會列出支持的設(shè)備铆惑,然后在網(wǎng)上下載對應(yīng)的文件
四十六亡问,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系統(tǒng) SVProgressHud crash在 self.hudView.motionEffects = @[];
self.hudView.motionEffects = [NSArray array];
四十八,swift項目 ios8dyld: Symbolnot found: _NSArray0
4dyld: Symbol not found: ___NSArray0__Referencedfrom: /private/var/mobile/Containers/Bundle/Application/5C6F5D69-5D14-4C07-BEA4-F410C18C66CC/DGBao.app/DGBao
Expectedin: /System/Library/Frameworks/CoreFoundation.framework/CoreFoundationin/private/var/mobile/Containers/Bundle/Application/5C6F5D69-5D14-4C07-BEA4-F410C18C66CC/DGBao.app/DGBao
解決辦法:
改為 optinal
APP在前臺眼溶,過會手機自動鎖屏悠砚,過個3分鐘之后,解鎖手機堂飞,app自動被殺掉的原因
解決方法:
可能在
- (void)applicationDidEnterBackground:(UIApplication *)application進入后臺的方法中使用了調(diào)用了下列方法:
[[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^(){
//程序在10分鐘內(nèi)未被系統(tǒng)關(guān)閉或者強制關(guān)閉灌旧,則程序會調(diào)用此代碼塊,可以在這里做一些保存或者清理工作
NSLog(@"程序關(guān)閉");
}];