使用hidesBottomBarWhenPushed問題
問題描述:
從ViewController2push到ViewController3,ViewController2 設(shè)置 hidesBottomBarWhenPushed屬性,實(shí)現(xiàn)tabbar被隱藏。
TestViewControllerTwo *two = [[TestViewControllerTwo alloc]init];
two.hidesBottomBarWhenPushed = true;
[self.navigationController pushViewController:two animated:true];
在使用ViewController2界面的時(shí)候由于業(yè)務(wù)邏輯,需要退出界面,并切換選中的tabbarItem,跳轉(zhuǎn)界面至ViewController1,會(huì)發(fā)現(xiàn)tabbar“不會(huì)在顯示回來”。
[self.navigationController popViewControllerAnimated:true];
[self.navigationController.tabBarController setSelectedIndex:0];
解決過程
首先在ViewController1及ViewController3打印tabbar的hidden屬性,值等于false,因此無法使用hidden屬性控制tabbar顯示。
猜測(cè)由于[self.navigationController popViewControllerAnimated:true];動(dòng)畫返回界面,并且直接切換控制器界面,導(dǎo)致tabbar沒有及時(shí)顯示,將其改為[self.navigationController popViewControllerAnimated:false];,問題解決。
問題修復(fù)
[self.navigationController popViewControllerAnimated:false];
[self.navigationController.tabBarController setSelectedIndex:0];
靜態(tài)庫沖突問題
問題描述:
開發(fā)中接入三方靜態(tài)庫文件實(shí)現(xiàn)功能,打包編譯后發(fā)現(xiàn)與原有靜態(tài)庫內(nèi)置文件名稱沖突。
解決過程
查找兩個(gè)靜態(tài)庫的來源為同一家公司,查閱有關(guān)靜態(tài)庫文件沖突資料,解決方法來源于有關(guān).a(靜態(tài)庫)沖突問題
。
問題修復(fù)
備份源文件,把這兩個(gè).a文件“中的一個(gè)”.a文件生成對(duì)應(yīng)架構(gòu)的.a文件,然后把這個(gè).a文件解壓縮成.o文件,刪除里面看到的重復(fù)的.o文件。然后再把這個(gè)對(duì)應(yīng).o文件合成對(duì)應(yīng)架構(gòu)的.a文件,再把多個(gè)架構(gòu)的.a文件合成一個(gè).a文件。最后把項(xiàng)目里的.a文件替換成自己處理過的.a文件。測(cè)試通過,編譯正常運(yùn)行。
注:方法僅限于三方靜態(tài)庫來源一致,一定要備份源文件。
附流程:
假設(shè).a文件名稱為test.a,將其放置一個(gè)單獨(dú)的文件夾“Test”中
終端
$ cd "Test文件夾路徑"
$ lipo -info test.a //可以看到armv7/arm64等字眼。就說明這個(gè)test.a包含了幾種架構(gòu)包。
//根據(jù)里面含有幾種架構(gòu)包就執(zhí)行相應(yīng)命令
//例:
$ lipo test.a -thin armv7 -output test_armv7.a
$ lipo test.a -thin i386 -output test_i386.a
//在Test文件夾得到libx-armv7.a 等等
//創(chuàng)建一個(gè)文件夾用于解壓架構(gòu)包文件
$ mkdir armv7
$ cd armv7
// 解壓上一級(jí)目錄下的armv7架構(gòu)包文件
$ ar -x ../libx-armv7.a
//在armv7文件夾中找到對(duì)應(yīng)的文件刪除后生成新的armv7.a文件
$ libtool -static -o ../test_newarmv7.a *.o //【.a 和 * 號(hào)之間有一個(gè)空格】
// 重復(fù)生成其他對(duì)應(yīng)架構(gòu)包 創(chuàng)建文件夾 解壓 刪除沖突文件 生成新的靜態(tài)庫包
//合并所有新的架構(gòu)包
$ lipo -create test_newarmv7.a test_newi386.a -output test.a