1.在項(xiàng)目中碰到一個(gè)問題:在UIWebView中痊远,調(diào)用原生相機(jī)或圖庫伸头,程序會(huì)重啟到啟動(dòng)畫面塘雳。查看打印信息陆盘,如下:
Warning: Attempt to present <UIImagePickerController: 0x12734be00> on <MBTabBarVC: 0x1270fc000> whose view is not in the window hierarchy!
網(wǎng)上查了很多資料才知道,選擇一個(gè)選項(xiàng)時(shí)败明,會(huì)把當(dāng)前的ViewController dismiss掉隘马,但是這里貌似是一個(gè)bug,dismiss了兩次妻顶,結(jié)果第二次把tabbar(我的項(xiàng)目是tabbar-nav-viewController)給銷毀了(斷點(diǎn)到dealloc可以看到)酸员,然后就理所當(dāng)然的崩潰了。
解決辦法:
在自定義的tabbar中讳嘱,重寫dismiss方法幔嗦,之所以第二次會(huì)dismiss tabbar,是因?yàn)榈诙蝑ismiss時(shí)沥潭,self.presentedViewController是一個(gè)nil邀泉。所以解決代碼如下:
-(void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))completion
{
if ( self.presentedViewController)
{
[super dismissViewControllerAnimated:flag completion:completion];
}
}
參考:ios 10 在WebView中選擇文件上傳 出現(xiàn) whose view is not in the window hierarchy!
2.Xcode 7以后沒有dylib文件
解決辦法:
- Go to Build Phases >Link Binary with Librairies > + > Add other
- Once in the file selection window do "CMD"+Shift+G (Go to folder) and type /usr/lib/
- From /usr/lib you can add : libz.dylib and more...
- Compile and have fun
3.Profile doesn't match the entitlements file's value for the application-identifier entitlement
解決辦法:
target-capbilities-打開iCloud,然后關(guān)閉icloud叛氨,即可
Profile doesn't match the entitlements file's value for the application-identifier entitlement