release 情況下資源加載不出來的問題
上個版本上線后突然發(fā)現(xiàn)了一個問題,GIF加載動畫不出來了?!
切換到release環(huán)境下,100%的復(fù)現(xiàn)的bug
定位到問題在
YYImage *image = [YYImage imageNamed:@"qfloading.gif"];
里
path = [[NSBundle mainBundle] pathForResource:scaledName ofType:e];
這里path返回nil.
那解決辦法就找到了:
Build Phases -> Copy Bundle Resources 將gif加進去后,問題就解決了,release情況下gif可以正常顯示了
疑問:以前gif資源是放在Images.xcassets里的,而且線上也是沒有問題的,只有這個版本出現(xiàn)了問題,而且debug環(huán)境下沒有問題
上傳包到商店卡在authenticating with the app store
code11 在第一次上傳ipa的時候,需要更新上傳依賴的文件包. 依賴的上傳文件包沒有更新下來導(dǎo)致的上傳失敗.切換網(wǎng)絡(luò)環(huán)境(我用手機開的熱點好了),或者也可以
//1.刪掉
~/Library/Caches/com.apple.amp.itmstransporter/
//2.重新執(zhí)行
/Applications/Transporter.app/Contents/itms/bin/iTMSTransporter
系統(tǒng)圖片出現(xiàn)灰色邊框的問題
iOS13發(fā)布后,UIImage有一個新增方法imageWithTintColor:,可以改變圖片的顏色
_imgView.image = [image imageWithTintColor:[UIColor redColor]];
有一些三方庫的類擴展比如 UIImage+Additions可能覆蓋了這個方法,導(dǎo)致出現(xiàn)這種系統(tǒng)icon出現(xiàn)灰色邊框的現(xiàn)象,刪掉這些方法就可以了
UDID OpenUDID ASID 和UUID
UDID 設(shè)備唯一標識符勋功,但是iOS 5以后禁用了
OpenUDID
// 廣告標識符IDFA
[[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]
//應(yīng)用加設(shè)備綁定產(chǎn)生的標識符
[[[UIDevice currentDevice] identifierForVendor] UUIDString]
//UUID
[[NSUUID UUID] UUIDString]
UITextFied 里輸入
123 456 789
然后選中456,刪除
會將123 和456中間的空格也刪掉盟步。。
我只是要刪掉456磅锝帷H磁獭!誰叫你給我刪空格的O彼黄橘!
2. ios 14.0 UIMenuController 不出現(xiàn)
amazing ?
其他項目里都可以屈溉,寫得demo也可以塞关。就是目前項目中未出來,原因未知子巾,轉(zhuǎn)交其他同學(xué)處理~
線上是正常的帆赢,tf包不正常小压。離了個大譜!椰于!
iOS 14.7.1reloadInputViews 會觸發(fā)keyboardWillHide的通知怠益,造成input跳動~
- (void)viewDidLoad {
[super viewDidLoad];
_tf = [[UITextView alloc] initWithFrame:CGRectMake(10, 100, 200, 50)];
_tf.backgroundColor = [UIColor redColor];
[self.view addSubview:_tf];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardHidden:) name:UIKeyboardWillHideNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardShow:) name:UIKeyboardWillShowNotification object:nil];
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
UIView *vie = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 100)];
vie.backgroundColor = [UIColor redColor];
self.tf.inputAccessoryView = self.tf.inputAccessoryView != nil ? nil : vie;
[self.tf reloadInputViews];
}
- (void)keyboardHidden:(NSNotification *)noti {
NSLog(@"keyboardHidden");
}
- (void)keyboardShow:(NSNotification *)noti {
NSLog(@"keyboardShow");
}
14.7.1 log:
inputAccessoryView 為nil時
keyboardShow
nputAccessoryView 為存在View時:
keyboardHidden
keyboardShow
13.6 log:
inputAccessoryView 為nil時
keyboardShow
nputAccessoryView 為存在View時:
keyboardShow
可以看到,當nputAccessoryView 存在時廉羔,14.7會多執(zhí)行一次keyboardHidden通知
目前解決方案:
刷新鍵盤時溉痢,添加控制:
self.reloadInputViewLock = YES;
[self.inputBoxView.textContainerView.textView.internalTextView reloadInputViews];
self.reloadInputViewLock = NO;
- (void)keyboardHidden:(NSNotification *)noti
{
if (self.reloadInputViewLock) {
return;
}
僻造。憋他。。
}
當打包機的內(nèi)存不夠時候髓削,會出現(xiàn)部分圖片資源打不進去的問題竹挡。
打出來的包在部分機型上會出問題
** Assertion failure in -[_UIImageCGImageContent initWithCGImage:scale:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKitCore_Sim/UIKit-3901.4.2/_UIImageContent.m:336
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Need an imageRef'
在組件打包為二進制后,部分宏定義會失效立膛,比如斷言揪罕,或者當前開發(fā)環(huán)境等。 可能會遺漏一部分錯誤信息宝泵,但是優(yōu)點也非常明顯好啰,加快了編譯速度.
當運行內(nèi)存不足時,會爆指針錯誤儿奶,目前項目中有非常多的類型情況框往,特別是YYText
Attempted to dereference garbage pointer 0xc.Originated at or in a subcall of bool
invalid update: invalid number of rows in section 0. the number of rows contained in an existing section after the update (20) must be equal to the number of rows contained in that section before the update (20), plus or minus the number of rows inserted or deleted from that section (0 inserted, 1 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out).'
tableView 和 collectionView的cell操作引起的問題,原因往往是數(shù)據(jù)源和cell不一致導(dǎo)致闯捎。
deleteRowsAtIndexPaths
insertSections
類似操作一定要加好判斷椰弊,不然很容易引起類似問題