一、首先是遇到的一個crash問題,是由於新浪微博SDK引發的(咱們用到了shareSDK來作分享),更新shareSDK便可。html
二、網絡請求失敗: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.ios
緣由:iOS9默認使用HTTPS請求es6
解決方法(二選一):1)讓服務器支持httpsapi
2)暫時退回http請求:在工程的Info.plist文件裏添加NSAppTransportSecurity字典類型的,添加一個元素:key爲NSAllowsArbitraryLoads,值爲YES數組
三、運行時報錯(但並未crash):<Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.服務器
緣由:設置app的狀態欄樣式的使用使用了舊的方式,在info.plist裏面設置了View controller-based status bar appearance爲NO ,默認爲YES,通常式iOS6的時候使用這種方式,iOS7,8也兼容,可是到了iOS9就報了警告。微信
解決方法:刪除原先設置狀態欄樣式的代碼,並將View controller-based status bar appearance設置爲YES網絡
四、bitcode問題app
緣由:Xcode7以後會默認開啓的(bitcode相關解釋參考http://www.cocoachina.com/ios/20150818/13078.html),而項目中用到的SDK未支持bitcodeui
解決方法(二選一):1)更新全部sdk
2)暫時關閉bitcode build setting -->build options -->enable bitcode 設置爲NO.
五、XCode7連接第三方庫提示warning:
warning:Could not resolve external type c:objc(cs)NSString
warning: Could not resolve external type c:objc(cs)NSDictionary
warning: Could not resolve external type c:objc(cs)NSMutableString
warning: Could not resolve external type c:objc(cs)NSError
...
解決方法:1) Go to Build Settings -> Build Options -> Debug Information Format
2) Change the Debug setting from "DWARF with dSYM File" to "DWARF"
3) Leave the Release setting at "DWARF with dSYM File"
The problem appears to be that Xcode was trying to create dSYM files for Debug builds. You don't need dSYM files for Debug builds -- it's release builds where you need them.
六、iOS 9使用URL scheme必須將其加入白名單:
編譯時報錯:canOpenURL: failed for URL: "mqqopensdkapiV2://qqapp" - error: "This app is not allowed to query for schememqqopensdkapiV2」
解決方法:Info.plist文件中添加一個key爲LSApplicationQueriesSchemes的數組值,裏面包含須要添加白名單的string類型的 scheme。在項目中使用了qq,微信等分享登陸功能,須要添加的值爲:
mqqopensdkapiV2
mqqOpensdkSSoLogin
mqq
mqzoneopensdkapiV2
mqzoneopensdkapi19
mqzoneopensdkapi
mqzoneopensdk
mqzone
weixin
wechat
sinaweibo,
sinaweibohd,
sinaweibosso,
sinaweibohdsso,
weibosdk,
weibosdk2.5 更多的白名單可查看http://wiki.mob.com/ios9-對sharesdk的影響(適配ios-9必讀)/ (不是打廣告哦...)
七、系統framework問題,升級以後framework全變紅了(並不影響程序運行),替換成9.0版本的framework便可,舊版本的 .dylib後綴庫文件在Xcode7中已經換成 .tbd了,相應進 行替換便可
8.解決警告「ld: warning: directory not found for option」
從項目中刪除了某個目錄、文件之後,編譯出現警告信息:
ld: warning: directory not found for option「XXXXXX」
很奇怪,爲何已經從項目中刪除了文件和文件夾仍是報這個警告呢?
去掉警告的辦法以下:
1選擇工程, 編譯的 (targets)
2選擇 Build Settings 菜單
3查找 Library Search Paths 和 Framework Search Paths, 刪掉編譯報warning的路徑即OK