iOS 开发经验总结
iOS 開(kāi)發(fā)經(jīng)驗(yàn)總結(jié)http://www.cocoachina.com/ios/20170216/18699.html
1.cocoa pods 常用的framework
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | platform?:ios,?'7.0' target?'store'?do pod?'AFNetworking',?'~>?3.1.0' pod?'JSONKit',?'~>?1.5pre' pod?'MBProgressHUD',?'~>?0.9.2' pod?'SDWebImage',?'~>?3.7.6' pod?'SVPullToRefresh',?'~>?0.4.1' pod?'JTObjectMapping',?'~>?1.1.2' pod?'MagicalRecord',?'~>?2.3.2' pod?'GetuiSDK',?'~>?1.4.2' pod?'XTSafeCollection',?'~>?1.0.4' pod?'libWeChatSDK',?'~>?1.6.2' pod?'XMLDictionary',?'~>?1.4' pod?'Masonry',?'~>?1.0.0' pod?'OpenUDID',?'~>?1.0.0' pod?'SAMKeychain',?'~>?1.5.0' pod?'iVersion',?'~>?1.11.4' pod?'iCloudDocumentSync',?'~>?7.4.1' end |
2.NSInteger打印以及字符串的轉(zhuǎn)換
使用%zd打印NSInteger, %tu打印NSUInteger。
| 1 2 3 4 5 | NSInteger?integer?=?1; NSLog(@"first?number:?%zd",?integer); NSUInteger?uinteger?=?1; NSLog(@"second?number:?%tu",?uinteger); |
3.UIScrollView 在iOS7中使用了Autolayout 導(dǎo)致不能滾動(dòng)
| 1 2 3 | -?(void)viewDidLayoutSubviews { ?????[_mainScrollView?setContentSize:CGSizeMake(SCREEN_WIDTH,?SCREEN_HEIGHT?+?10)];//增加10個(gè)像素讓scrollview可上下滑動(dòng)} |
添加scrollView的content高度.
4.APP包瘦身
1)刪除項(xiàng)目中沒(méi)有使用的圖片。?查找XCode工程中沒(méi)被使用的圖片資源
2)刪除項(xiàng)目中沒(méi)有用到的class 和 xib 及storyboard。分析工程中沒(méi)有用到class
安裝 fui 工具
sudo gem install fui -n /usr/local/bin
fui usage:?https://github.com/dblock/fui
到工程目錄下,執(zhí)行 fui find 命令,可以找出所有的沒(méi)有用到的class文件。
3)分析ipa包,找出大于500K的文件或內(nèi)容 使用
| 1 | find?.?-type?f?-size?+500000c?|?xargs?ls?-lh |
圖形搜索法
5.直接iOS7的連續(xù)跳轉(zhuǎn)
| 1 2 3 4 5 6 7 | -?(void)back { ????[self?dismissViewControllerAnimated:YES ?????????????????????????????completion:^{?????????????????????????????????if?(self.loginCanceled)?{?????????????????????????????????????self.loginCanceled();?????????????????????????????????????self.loginCanceled?=?nil; ?????????????????????????????????} ?????????????????????????????}]; } |
其中l(wèi)oginCanceled的實(shí)現(xiàn)
| 1 | [weakSelf.navigationController?popViewControllerAnimated:YES]; |
6.去除Preferred Max 的警告
警告的原因:
-
xib或storyboard中添加了UILabel的控件
-
UILabel的number lines 大于1
-
UILabel的preferred max沒(méi)有設(shè)置值(?@property(nonatomic) CGFloat preferredMaxLayoutWidth NS_AVAILABLE_IOS(6_0);)
解決方法:
1)如果是Storyboard的,右鍵點(diǎn)擊警告
警告
2)查看警告的詳情
詳情
3)復(fù)制ID的值在搜索框中進(jìn)行搜索
搜索
4)點(diǎn)擊搜索到的Label,可以找到label
找到Label
5)設(shè)置preferred width為0,并選中explicit
設(shè)置
6)警告解決
如果警告的是Xib,直接點(diǎn)擊警告
xib
就會(huì)跳轉(zhuǎn)到對(duì)應(yīng)的UILabel控件,設(shè)置preferred width為0,并選中explicit。 警告解決。
7.Cocoa pods更新到1.0 不能用了
更新完cocoa pods后,執(zhí)行pod install后提示
Errno::ENOTEMPTY - Directory not empty @ dir_s_rmdir - /Users/arthurwang/SVN///*/Pods
[!] Oh no, an error occurred.Search for existing GitHub issues similar to yours:https://github.com/CocoaPods/CocoaPods/search?q=Directory+not+empty+%40+dir_s_rmdir+-+%2FUsers%2Farthurwang%2FSVN%2F59Store%2Fstoreapp-ios%2Fstore%2FPods&type=IssuesIf?none exists, create a ticket, with the template displayed above, on:https://github.com/CocoaPods/CocoaPods/issues/newBe?sure to first read the contributing guide for details on how to properly submit a ticket:https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md
Don't forget to anonymize any private data!
解決方法:
刪除項(xiàng)目中的Pods文件夾,再進(jìn)行pod install的安裝
8.interactivepopgesturerecognizer 使用
設(shè)置left bar button后,會(huì)導(dǎo)致右滑返回的效果失效,查看完美的設(shè)置方案。
同時(shí)為了獲取到右滑返回的事件,可以執(zhí)行
[self.navigationController.interactivePopGestureRecognizer addTarget:self action:@selector(back)];
在ViewController中viewDidAppare中添加,在viewWillDisappear中remove。
9.更新Cocoapods上的代碼
1)采用私有的Cocoapods管理代碼,需要添加
pod repo add HXSpec git@code.59store.com:ios/HXSpecs.git
將私有的Spec管理Git添加到pod的specs中。為了方便更新私有庫(kù)。
2)在使用Cocoapods管理代碼的時(shí)候,如果在GitHut上更新了代碼,希望在project中執(zhí)行pod install 來(lái)刷新代碼,那么需要?jiǎng)h除Pods和Podfile.lock文件
然后在執(zhí)行pod install 來(lái)刷新代碼
使用pod update進(jìn)行repo的更新(更新私有庫(kù))
3)多次安裝pod install 會(huì)出現(xiàn)Build Phase里多個(gè)Check Pods Manifest.lock的選項(xiàng),這些選項(xiàng)可以刪除。
采用直接將specs文件放到HXSpecs的管理庫(kù)中,那么需要執(zhí)行pod update 進(jìn)行
Updating local specs repositories
不然會(huì)報(bào)錯(cuò)
4)刪除這個(gè)目錄下的緩存文件,進(jìn)行第三方庫(kù)文件的重新獲取
/Users/arthurwang/Library/Caches/CocoaPods/Pods
5)進(jìn)行兩個(gè)組件相互依賴的時(shí)候,會(huì)導(dǎo)致報(bào)錯(cuò):
[!] There is a circular dependency between StoreLocation and StoreBase
10. UICollectionView的數(shù)據(jù)不夠,無(wú)法滑動(dòng)——解決方案
tableView的數(shù)據(jù)無(wú)論多少,它的界面默認(rèn)都是可以滑動(dòng)的。
和tableView相比,當(dāng)collectionView的數(shù)據(jù)較少不夠一個(gè)屏幕時(shí),它無(wú)法滑動(dòng)。
解決方案:
| 1 | _collectionView.alwaysBounceVertical?=?YES; |
設(shè)置為總能垂直滑動(dòng)就OK了。
11.MLeaksFinder 檢查內(nèi)存泄露
MLeaksFinder 直接用Pod導(dǎo)入就可以。根據(jù)DEBUG這個(gè)宏,開(kāi)啟內(nèi)存泄露的檢查,如果發(fā)現(xiàn)內(nèi)存泄露,將斷言。 So Good
12.刪除String的中文
思路: 采用刪除不用需要保留的字符,來(lái)實(shí)現(xiàn)刪除中文的目的
| 1 2 3 4 5 6 7 | //數(shù)字和字母 #define?ALPHANUM?@"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" //數(shù)字 #define?NUM?@"0123456789" NSCharacterSet?*cs?=?[[NSCharacterSet?characterSetWithCharactersInString:ALPHANUM]?invertedSet]; NSString?*filteredStr?=?[[textStr?componentsSeparatedByCharactersInSet:cs]?componentsJoinedByString:@""]; |
另外:UITextField 只能輸入數(shù)字和字母
| 1 2 3 4 | [[NSNotificationCenter?defaultCenter]?addObserver:self ?????????????????????????????????????????????selector:@selector(textFieldChanged:) ?????????????????????????????????????????????????name:UITextFieldTextDidChangeNotification ???????????????????????????????????????????????object:nil]; |
監(jiān)聽(tīng)name:UITextFieldTextDidChangeNotification?和?- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
一起使用,來(lái)實(shí)現(xiàn)。
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | -?(BOOL)validatePasswordString:(NSString?*)resultMStr { ????BOOL?result?=?YES; ????switch?(self.mode)?{ ????????case?HXSChangePasswordLogin:?{ ????????????NSString?*regex?=?@"^[a-zA-Z0-9]+$"; ????????????NSPredicate?*pred?=?[NSPredicate?predicateWithFormat:@"SELF?MATCHES?%@",?regex]; ????????????result?=?[pred?evaluateWithObject:resultMStr]; ????????????break; ????????} ????????case?HXSChangePasswordPay:?{ ????????????NSString?*regex?=?@"^[0-9]+$"; ????????????NSPredicate?*pred?=?[NSPredicate?predicateWithFormat:@"SELF?MATCHES?%@",?regex]; ????????????result?=?[pred?evaluateWithObject:resultMStr]; ????????????break; ????????} ????} ????return?result; } |
13.iOS8 以后用WKWebView替代UIWebView
iOS8 之前使用UIWebView進(jìn)行html的展示,使用UIWebView存在內(nèi)存占用過(guò)大并不釋放的問(wèn)題。
WKWebView解決了內(nèi)存占用過(guò)大的問(wèn)題。
14.Xib中UILabel換行
在Xib中輸入很長(zhǎng)的文字,需要根據(jù)編號(hào)進(jìn)行換行時(shí),按“Enter”鍵無(wú)效。
方法:將文字在Text編輯工具編寫好,copy到UILabel上。換行就有了
15.workspace — project — targets 講解
一個(gè)工作空間可以包含多個(gè)項(xiàng)目,一個(gè)項(xiàng)目可以包含多個(gè)目標(biāo)(生成物)。
一個(gè)項(xiàng)目中根據(jù)運(yùn)行的targets不同,可以進(jìn)行不同的編譯設(shè)置,project是基礎(chǔ)父類,targets是子類,targets的設(shè)置會(huì)覆蓋project的設(shè)置。
16.繪畫虛線, drawRect繪畫frame未定的情況
| 1 2 3 | [yourView.layer?setBorderWidth:5.0]; [yourView.layer?setBorderColor: [[UIColor?colorWithPatternImage:[UIImage?imageNamed:@"DotedImage.png"]]?CGColor]];//just?add?image?name?and?create?image?with?dashed?or?doted?drawing?and?add?here |
這里只需要添加QuartzCore/QuartzCore.h框架,像下面一樣導(dǎo)入.m文件:
注意:
當(dāng)使用Autolayout后,繪畫虛線是根據(jù)frame進(jìn)行的,那么在
| 1 2 3 4 | -?(void)drawRect:(CGRect)rect { ????[self?drawBorderLayer]; } |
drawRect方法中,進(jìn)行繪畫。
17.Array 的深復(fù)制
指針的復(fù)制
dataArray3=[dataArray2 mutableCopy];
知識(shí)對(duì)dataArray2 進(jìn)行了深復(fù)制,數(shù)組中的內(nèi)容僅僅是指針的復(fù)制。
單層深復(fù)制
dataArray3=[[NSMutableArray alloc]initWithArray:dataArray2 copyItems:YES];
dataArray2進(jìn)行本身和內(nèi)容的深復(fù)制。單僅僅是內(nèi)容的第一層
完全深復(fù)制
dataArray3 = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:dataArray2]];
不管多少層都可以進(jìn)行了深復(fù)制
18.企業(yè)證書下載版本可在APP中直接打開(kāi)
在APP中有H5的頁(yè)面,可以直接點(diǎn)擊進(jìn)行其他應(yīng)用的下載
19.URL中對(duì)“#”的處理
| 1 2 3 4 | NSString?*str?=?@"http://test.fd.com/#/dte{}|||?lsfj=12&sdlfj=34&hao=你好";??????? NSURL?*url?=?[NSURL?URLWithString:[str?stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet?characterSetWithCharactersInString:@"`%^{}\"[]|\\<>?"].invertedSet]]; NSLog(@"url?is?%@",?url); |
輸出:?http://test.fd.com/#/dte%7B%7D%7C%7C%7C?lsfj=12&sdlfj=34&hao=%E4%BD%A0%E5%A5%BD
# 沒(méi)有被轉(zhuǎn)義
iOS9版本中需要使用?
stringByAddingPercentEncodingWithAllowedCharacters替代之前stringByAddingPercentEscapesUsingEncoding。
| 1 2 3 4 5 6 7 8 9 10 11 12 | NSString?*str?=?@"http://test.fd.com/#/dte{}|||?lsfj=12&sdlfj=34&hao=你好";??????? NSURL?*url?=?[NSURL?URLWithString:[str?stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; NSLog(@"[url?scheme]?is?%@.",?[url?scheme]); NSLog(@"[url?host]?is?%@.",?[url?host]); NSLog(@"[url?password]?is?%@.",?[url?password]); NSLog(@"[url?user]?is?%@.",?[url?user]); NSLog(@"[url?path]?is?%@.",?[url?path]); NSLog(@"[url?query]?is?%@.",?[url?query]); NSLog(@"[url?fragment]?is?%@.",?[url?fragment]); NSLog(@"[url?resourceSpecifier]?is?%@.",?[url?resourceSpecifier]); NSLog(@"[url?parameterString]?is?%@.",?[url?parameterString]); NSLog(@"[url?relativePath]?is?%@.",?[url?relativePath]); |
輸出:
2016-08-09 18:57:52.913 store[20150:672790] [url scheme] is http.
2016-08-09 18:57:52.913 store[20150:672790] [url host] is test.fd.com.
2016-08-09 18:57:52.914 store[20150:672790] [url password] is (null).
2016-08-09 18:57:52.914 store[20150:672790] [url user] is (null).
2016-08-09 18:57:52.914 store[20150:672790] [url path] is /#/dte{}|||.
2016-08-09 18:57:52.914 store[20150:672790] [url query] is lsfj=12&sdlfj=34&hao=%E4%BD%A0%E5%A5%BD.
2016-08-09 18:57:52.914 store[20150:672790] [url fragment] is (null).
2016-08-09 18:57:52.915 store[20150:672790] [url resourceSpecifier] is //test.fd.com/%23/dte%7B%7D%7C%7C%7C?lsfj=12&sdlfj=34&hao=%E4%BD%A0%E5%A5%BD.
2016-08-09 18:57:52.915 store[20150:672790] [url parameterString] is (null).
2016-08-09 18:57:52.915 store[20150:672790] [url relativePath] is /#/dte{}|||.
20.APP 啟動(dòng)頁(yè)不更新
修改了LaunchScreen.xib 后,模擬器上顯示正常,但是真機(jī)上沒(méi)有更新。
原因:?應(yīng)用緩存
解決:真機(jī)上刪除APP,重啟手機(jī),重新安裝APP。
21. httpsdns 使用
申請(qǐng) account id 下載sdk
查看SDK 文檔 初始化,替換域名為IP
https://help.aliyun.com/document_detail/30116.html?spm=5176.product30100.4.28.bLXrJ4
在阿里云 里配置域名
22.打印不出變量的值 都顯示nil
當(dāng)對(duì)某個(gè)變量進(jìn)行調(diào)試的并打印值時(shí),一直返回nil。但是界面又能顯示內(nèi)容。
原因:說(shuō)明這個(gè)變量是在某個(gè)線程中,而調(diào)試的不在這個(gè)線程里。
23.判斷是否為gif/png圖片的正確姿勢(shì)
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | //通過(guò)圖片Data數(shù)據(jù)第一個(gè)字節(jié)?來(lái)獲取圖片擴(kuò)展名 -?(NSString?*)contentTypeForImageData:(NSData?*)data { ????uint8_t?c; ????[data?getBytes:&c?length:1]; ????switch?(c) ????{ ????????case?0xFF: ????????????return?@"jpeg"; ????????case?0x89: ????????????return?@"png"; ????????case?0x47: ????????????return?@"gif"; ????????case?0x49: ????????case?0x4D: ????????????return?@"tiff"; ????????case?0x52: ????????if?([data?length]?<?12)?{ ????????????return?nil; ????????} ????????NSString?*testString?=?[[NSString?alloc]?initWithData:[data?subdataWithRange:NSMakeRange(0,?12)]?encoding:NSASCIIStringEncoding]; ????????if?([testString?hasPrefix:@"RIFF"] ????????????&&?[testString?hasSuffix:@"WEBP"]) ????????{ ????????????return?@"webp"; ????????} ????????return?nil; ????} ????return?nil; } |
其實(shí)圖片數(shù)據(jù)的第一個(gè)字節(jié)是固定的,一種類型的圖片第一個(gè)字節(jié)就是它的標(biāo)識(shí), 我們來(lái)調(diào)用一下這個(gè)方法:
| 1 2 3 4 5 6 7 | //假設(shè)這是一個(gè)網(wǎng)絡(luò)獲取的URL NSString?*path?=?@"http://pic.rpgsky.net/images/2016/07/26/3508cde5f0d29243c7d2ecbd6b9a30f1.png"; NSData?*data?=?[NSData?dataWithContentsOfURL:[NSURL?URLWithString:path]]; //調(diào)用獲取圖片擴(kuò)展名 NSString?*string?=?[self?contentTypeForImageData:data]; //輸出結(jié)果為?png NSLog(@"%@",string); |
24.JSPatch 的convertor 工具使用
左邊輸入
| 1 2 3 4 5 6 7 8 | @implementation?HXSAdTableViewCell +?(CGFloat)getCellHeightWithObject:(HXSStoreAppEntryEntity?*)storeAppEntryEntity { ????CGFloat?scale?=?[storeAppEntryEntity.imageHeightIntNum?floatValue]/[storeAppEntryEntity.imageWidthIntNum?floatValue]; ????? ????return?([UIScreen?mainScreen].bounds.size.width)?/?3?*?scale?+?30; } @end |
右邊輸出
| 1 2 3 4 5 6 7 8 | require('UIScreen'); defineClass('HXSAdTableViewCell',?{}?{ getCellHeightWithObject:?function(storeAppEntryEntity)?{ ????var?scale?=?storeAppEntryEntity.imageHeightIntNum().floatValue()?/?storeAppEntryEntity.imageWidthIntNum().floatValue(); ????? ????return?(UIScreen.mainScreen().bounds().size().width())?/?3?*?scale?+?30; }, }); |
有一個(gè)BUG:?defineClass('HXSAdTableViewCell', {} {?在{}后面少一個(gè)“,”。
正確:
| 1 2 3 4 5 6 7 8 | require('UIScreen'); defineClass('HXSAdTableViewCell',?{},?{ getCellHeightWithObject:?function(storeAppEntryEntity)?{ ????var?scale?=?storeAppEntryEntity.imageHeightIntNum()?/?storeAppEntryEntity.imageWidthIntNum(); ????? ????return?(UIScreen.mainScreen().bounds().width)?/?3?*?scale?+?30; }, }); |
25.Navigation bar的left bar button 跳動(dòng)
| 1 2 3 4 5 6 7 | -?(void)jumpToViewController:(UIViewController?*)vc { ????//?show?the?navigation?bar?in?other?vcs ????[self.navigationController?setNavigationBarHidden:NO]; ????? ????[self.navigationController?pushViewController:vc?animated:YES]; } |
當(dāng)設(shè)置了?self.navigationItem.leftBarButtonItem.imageInsets = self.navigationController.viewControllers.count == 1 ? UIEdgeInsetsZero : UIEdgeInsetsMake(0, -5, 0, 5);
那么進(jìn)行顯示navigation bar的時(shí)候,就引起left bar button的跳動(dòng)。
可以設(shè)置navigation bar hidden在push之前來(lái)解決。
26.Xcode8 出現(xiàn)ubsystem: com.apple.UIKit, category: HIDEventFiltered。。。的日志
解決辦法:【product】-【scheme】-【Edit Scheme】-【Run】-【Argument】-【Environment Variable】添加keyValue【OS_ACTIVITY_MODE disable】可以停止輸出打印此日志
27.intrinsic size 同一行有2個(gè)可變長(zhǎng)度的的UILabel
Content Hugging Priority代表控件拒絕拉伸的優(yōu)先級(jí)。優(yōu)先級(jí)越高,控件會(huì)越不容易被拉伸。
而下面的Content Compression Resistance Priority代表控件拒絕壓縮內(nèi)置空間的優(yōu)先級(jí)。優(yōu)先級(jí)越高,控件的內(nèi)置空間會(huì)越不容易被壓縮
設(shè)置Content Hugging Priority 和 Content Compression Resistance Priority, 可實(shí)現(xiàn)當(dāng)2個(gè)UILabel的內(nèi)容都很長(zhǎng)的時(shí)候,哪個(gè)label進(jìn)行壓縮,哪個(gè)Label進(jìn)行顯示完整。
28.pusher 推送測(cè)試
https://github.com/noodlewerk/NWPusher/releases/tag/0.7.0
直接進(jìn)行推送的測(cè)試。
29.float的精度解決
將NSNumber轉(zhuǎn)化為CGFloat時(shí),精度失真。
| 1 2 3 4 5 6 7 8 9 | NSString?*decimalNumberMutiplyWithString(NSString?*multiplierValue,NSString?*multiplicandValue) { ????NSDecimalNumber?*multiplierNumber?=?[NSDecimalNumber?decimalNumberWithString:multiplierValue]; ????NSDecimalNumber?*multiplicandNumber?=?[NSDecimalNumber?decimalNumberWithString:multiplicandValue]; ????NSDecimalNumber?*product?=?[multiplicandNumber?decimalNumberByMultiplyingBy:multiplierNumber]; ????return?[product?stringValue]; } NSLog(@"%@",decimalNumberMutiplyWithString([NSString?stringWithFormat:@"%f",a],?[NSString?stringWithFormat:@"%d",b]));?//輸出結(jié)果?999999.99 |
通過(guò)計(jì)算每一位的數(shù)字,再進(jìn)行string展示。
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | -?(NSString?*)convertStringFromFloatNum:(NSNumber?*)floatNum { ????NSNumberFormatter?*numberFormatter?=?[[NSNumberFormatter?alloc]?init]; ????[numberFormatter?setPositiveFormat:@"0.00"]; ????NSString?*tempFloatStr?=?[numberFormatter?stringFromNumber:[NSNumber?numberWithDouble:([floatNum?floatValue]?*?100)]];??//?yuan?to?fen ????NSInteger?tempInt?=?[tempFloatStr?integerValue]; ????NSInteger?result?=?tempInt?%?100; ????if?(0?==?result)?{ ????????NSString?*str?=?[NSString?stringWithFormat:@"%zd",?tempInt/100]; ????????return?str; ????} ????result?=?tempInt?%?10; ????if?(0?==?result)?{ ????????NSString?*str?=?[NSString?stringWithFormat:@"%zd.%zd",?tempInt/100,?(tempInt?%?100)/10]; ????????return?str; ????} ????NSString?*str?=?[NSString?stringWithFormat:@"%zd.%zd%zd",?tempInt/100,?(tempInt?%?100)/10,?(tempInt?%?100)]; ????return?str; } |
30.個(gè)推iOS10改動(dòng)
iOS 10 中 “l(fā)oc-key”和“body”(我們官網(wǎng)就是“message”)這二個(gè)字段的優(yōu)先級(jí)發(fā)生了變化,在iOS 10中“body”的優(yōu)先級(jí)大于“l(fā)oc-key”,在iOS 10以下“l(fā)oc-key”大于“body”,不推薦使用“body”傳遞數(shù)據(jù)
將Message(對(duì)應(yīng)body)中的數(shù)據(jù)放到payload中,將loc-key的數(shù)據(jù)放到message(對(duì)應(yīng)body)中,在iOS 10中就不會(huì)出現(xiàn)顯示代碼了
31.iOS10 默認(rèn)的frame
?
32.騰訊手機(jī)管家 騷擾攔截 數(shù)據(jù)庫(kù)更新失敗
騷擾攔截功能,進(jìn)行數(shù)據(jù)庫(kù)更新時(shí),如果是英文環(huán)境,一直會(huì)出現(xiàn)數(shù)據(jù)庫(kù)更新失敗,切換到中文環(huán)境,一次性就成功了。
?
轉(zhuǎn)載于:https://www.cnblogs.com/GJ-ios/p/6483091.html
總結(jié)
以上是生活随笔為你收集整理的iOS 开发经验总结的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 《重到城七绝句·张十八》是哪个时期的作品
- 下一篇: 参数传递模式