警告錯(cuò)誤整理(3)

一、隱藏自定義的tabbar 死活隱藏不了 ?

后來找朋友問了下 發(fā)現(xiàn) 我用的實(shí)例沒初始化 WTF!!!

于是余有嘆焉 ? 查bug 先打斷點(diǎn)看內(nèi)存 ?

二、在一個(gè)視圖里面用bringSubviewToFront 沒效果

應(yīng)該在同一個(gè)父視圖添加完其它視圖后 調(diào)用[self.view bringSubviewToFront:pickview];

三、Implicit conversion loses integer precision: 'NSUInteger' (aka 'unsigned long') to 'int'

implicit [?m'pl?s?t]adj. 含蓄的;暗示的;盲從的? 隱式( Implicit ) :對于給定變量,單元內(nèi)的未知值用鄰近單元的已知和未知值計(jì)算得出。

conversion [k?n'v?:??n]n. 轉(zhuǎn)換;變換;[金融] 兌換;改變信仰

loses ['lu:z?z]損失? integer ['?nt?d??]n. [數(shù)] 整數(shù);整體;完整的事物

precision [pri'si??n] n. 精度,[數(shù)] 精密度;精確

aka? ['?k?]. 又叫做,亦稱(also known as)

隱式轉(zhuǎn)換損失精度整數(shù):“NSUInteger”(又名“無符號長”)“int”

可以在前面添加個(gè)括號 強(qiáng)轉(zhuǎn)下 (int) ?也可以轉(zhuǎn)成 nsnumer ?intvalue

四、*** Terminating app due to uncaught exception 'RLMException', reason: 'Index is out of bounds.'

由于捕獲到異常RLMException 導(dǎo)致索引越界

terminate ['t??m?ne?t]vt. 使終止;使結(jié)束;解雇?vi. 結(jié)束,終止;結(jié)果?adj. 結(jié)束的

terminating [/'t?:mineiti?]n. [電] 終接?v. 結(jié)束;使終結(jié);解雇(terminate的現(xiàn)在分詞)

due to 由于因?yàn)? ? ? uncaught 捕獲 ? ? ? exceptionn. 例外;異議

*** First throw call stack:

libc++abi.dylib: terminating with uncaught exception of type NSException

五、關(guān)于隱藏電池條

本來是通過下面這個(gè)方法隱藏的電池條

- (BOOL)prefersStatusBarHidden{

return YES;

}

后來改動了 plist里面的 View controller-based status bar appearance項(xiàng)

設(shè)為了YES, 結(jié)果我上面那個(gè)方法就不走了?

在代碼里添加了[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO]; 就ok了?

補(bǔ)兩個(gè)tips

取info.plist中 View controller-based status bar appearance中的設(shè)置:

NSNumber *isVCBasedStatusBarAppearanceNum = [[NSBundle mainBundle]objectForInfoDictionaryKey:@"UIViewControllerBasedStatusBarAppearance"];

if (isVCBasedStatusBarAppearanceNum){

_isVCBasedStatusBarAppearance = isVCBasedStatusBarAppearanceNum.boolValue;

}? else {

_isVCBasedStatusBarAppearance = YES; // default

}

在view controller中調(diào)用setNeedsStatusBarAppearanceUpdate,更新status bar的顯示。

if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {

[self prefersStatusBarHidden];

[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];

六:Info.plist與Prefix.pch路徑錯(cuò)誤(轉(zhuǎn))

如果要更改Info.plist與Prefix.pch文件實(shí)際路徑,也就是實(shí)際文件的位置(不是在工程中的組織路徑),需要到Build Settings中修改對應(yīng)的配置,不然工程就找不到對應(yīng)的Info.plist與Prefix.pch文件。

報(bào)錯(cuò)情況:

1、Info.plist文件路徑錯(cuò)誤

error: could not read data from '/Users/sf_gxd/Desktop/Gasake/Gasake/Gasake-Info.plist': The file “Gasake-Info.plist” couldn’t be opened because there is no such file.

2、prefix.pch文件路徑錯(cuò)誤

clang: error: no such file or directory: '/Users/sf_gxd/Desktop/Gasake/Gasake/Gasake-Prefix.pch'

clang: error: no input files

prefix.pch
Info.plist

如果還是報(bào)錯(cuò)就是沒修改test里面的地址

Prefix.pch的路徑盡量用相對路徑$(SRCROOT) 不然路徑一有改動就要跑回去改

七.Xcode6以后 添加Prefix.pch文件的問題

(系統(tǒng)不生成了 盡量不用的好)用的話 在other里面新建 然后到build Setting里面 搜Prefix 是 Prefix 而不是pch因?yàn)檫@個(gè)時(shí)候里面有沒有 pch文件的 然后把地址拖進(jìn)去就可以了

八.unrecognized selector sent to instance 0x7fbdb05dbeb0'

ddbutton

button的監(jiān)聽事件添加習(xí)慣了 直接@selector了 ?在這個(gè)地方應(yīng)該是 把a(bǔ)ction 放進(jìn)去

不同情況不同對待 習(xí)慣亦可誤人

九.關(guān)于button 選中狀態(tài)下的TintColor顏色

[camerabtn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];

[camerabtn setTitleColor:[UIColor blueColor] forState:UIControlStateSelected];

左邊那個(gè)是選中狀態(tài) 后面那個(gè)藍(lán)色背景 是7以后的tintcolor造成的

所以在上述代碼后還要再添加一句[camerabtn setTintColor:[UIColor clearColor]];

去除tint顏色


十.迷之button?

今天搞的button無法點(diǎn)擊 最后發(fā)現(xiàn)是是由于位置偏離了父視圖的原因,搜狗輸入法又作死了?

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

推薦閱讀更多精彩內(nèi)容