一、隱藏自定義的tabbar 死活隱藏不了 ?
后來找朋友問了下 發現 我用的實例沒初始化 WTF!!!
于是余有嘆焉 ? 查bug 先打斷點看內存 ?
二、在一個視圖里面用bringSubviewToFront 沒效果
應該在同一個父視圖添加完其它視圖后 調用[self.view bringSubviewToFront:pickview];
三、Implicit conversion loses integer precision: 'NSUInteger' (aka 'unsigned long') to 'int'
implicit [?m'pl?s?t]adj. 含蓄的;暗示的;盲從的? 隱式( Implicit ) :對于給定變量,單元內的未知值用鄰近單元的已知和未知值計算得出。
conversion [k?n'v?:??n]n. 轉換;變換;[金融] 兌換;改變信仰
loses ['lu:z?z]損失? integer ['?nt?d??]n. [數] 整數;整體;完整的事物
precision [pri'si??n] n. 精度,[數] 精密度;精確
aka? ['?k?]. 又叫做,亦稱(also known as)
隱式轉換損失精度整數:“NSUInteger”(又名“無符號長”)“int”
可以在前面添加個括號 強轉下 (int) ?也可以轉成 nsnumer ?intvalue
四、*** Terminating app due to uncaught exception 'RLMException', reason: 'Index is out of bounds.'
由于捕獲到異常RLMException 導致索引越界
terminate ['t??m?ne?t]vt. 使終止;使結束;解雇?vi. 結束,終止;結果?adj. 結束的
terminating [/'t?:mineiti?]n. [電] 終接?v. 結束;使終結;解雇(terminate的現在分詞)
due to 由于因為? ? ? uncaught 捕獲 ? ? ? exceptionn. 例外;異議
*** First throw call stack:
libc++abi.dylib: terminating with uncaught exception of type NSException
五、關于隱藏電池條
本來是通過下面這個方法隱藏的電池條
- (BOOL)prefersStatusBarHidden{
return YES;
}
后來改動了 plist里面的 View controller-based status bar appearance項
設為了YES, 結果我上面那個方法就不走了?
在代碼里添加了[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO]; 就ok了?
補兩個tips
取info.plist中 View controller-based status bar appearance中的設置:
NSNumber *isVCBasedStatusBarAppearanceNum = [[NSBundle mainBundle]objectForInfoDictionaryKey:@"UIViewControllerBasedStatusBarAppearance"];
if (isVCBasedStatusBarAppearanceNum){
_isVCBasedStatusBarAppearance = isVCBasedStatusBarAppearanceNum.boolValue;
}? else {
_isVCBasedStatusBarAppearance = YES; // default
}
在view controller中調用setNeedsStatusBarAppearanceUpdate,更新status bar的顯示。
if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
[self prefersStatusBarHidden];
[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
六:Info.plist與Prefix.pch路徑錯誤(轉)
如果要更改Info.plist與Prefix.pch文件實際路徑,也就是實際文件的位置(不是在工程中的組織路徑),需要到Build Settings中修改對應的配置,不然工程就找不到對應的Info.plist與Prefix.pch文件。
報錯情況:
1、Info.plist文件路徑錯誤
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文件路徑錯誤
clang: error: no such file or directory: '/Users/sf_gxd/Desktop/Gasake/Gasake/Gasake-Prefix.pch'
clang: error: no input files
如果還是報錯就是沒修改test里面的地址
Prefix.pch的路徑盡量用相對路徑$(SRCROOT) 不然路徑一有改動就要跑回去改
七.Xcode6以后 添加Prefix.pch文件的問題
(系統不生成了 盡量不用的好)用的話 在other里面新建 然后到build Setting里面 搜Prefix 是 Prefix 而不是pch因為這個時候里面有沒有 pch文件的 然后把地址拖進去就可以了
八.unrecognized selector sent to instance 0x7fbdb05dbeb0'
button的監聽事件添加習慣了 直接@selector了 ?在這個地方應該是 把action 放進去
不同情況不同對待 習慣亦可誤人
九.關于button 選中狀態下的TintColor顏色
[camerabtn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
[camerabtn setTitleColor:[UIColor blueColor] forState:UIControlStateSelected];
左邊那個是選中狀態 后面那個藍色背景 是7以后的tintcolor造成的
所以在上述代碼后還要再添加一句[camerabtn setTintColor:[UIColor clearColor]];
去除tint顏色
十.迷之button?
今天搞的button無法點擊 最后發現是是由于位置偏離了父視圖的原因,搜狗輸入法又作死了?