1.iOS國際化
2.AutoLayout關(guān)于更新的幾個(gè)方法的區(qū)別:
setNeedsLayout:告知頁面需要更新芜壁,但是不會(huì)立刻開始更新。執(zhí)行后會(huì)立刻調(diào)用layoutSubviews妒牙。
layoutIfNeeded:告知頁面布局立刻更新。所以一般都會(huì)和 setNeedsLayout一起使用对妄。如果希望立刻生成新的frame需要調(diào)用此方法湘今,利用這點(diǎn)一般布局動(dòng)畫可以在更新布局后直接使用這個(gè)方法讓動(dòng)畫生效。
layoutSubviews:系統(tǒng)重寫布局
setNeedsUpdateConstraints:告知需要更新約束剪菱,但是不會(huì)立刻開始
updateConstraintsIfNeeded:告知立刻更新約束
updateConstraints:系統(tǒng)更新約束
3.Position and height are ambiguous for XXX 錯(cuò)誤
今天在編碼的時(shí)候碰到了這樣一個(gè)錯(cuò)誤摩瞎,找了好久都找不到問題所在,試了好多辦法琅豆,最后把控件的約束全部刪除重新添加一遍就可以了愉豺。這個(gè)應(yīng)該是Xcode的Bug篓吁。
4.開發(fā)的時(shí)候碰到這樣一個(gè)需求茫因,需要拖動(dòng)選擇數(shù)量,并且在拖動(dòng)的過程中變換當(dāng)前被選中的數(shù)字的顏色和大小杖剪。
于是博主利用UIcollectionView+UICollectionViewFlowLayout實(shí)現(xiàn)了下圖效果冻押。如果你也需要實(shí)現(xiàn)類似效果可以前往我的個(gè)人github下載。如果能夠幫到你希望能給博主點(diǎn)上星星盛嘿,謝謝支持_
如果你是iOS新人或者是之前沒有用過這個(gè)控件的開發(fā)者洛巢,那么博主推薦一篇對該控件介紹相對比較詳細(xì)的文章.UICollectionView很強(qiáng)大,非常有必要深入學(xué)習(xí)次兆。
5.在導(dǎo)入使用第三方庫的時(shí)候發(fā)現(xiàn)libsqlite有l(wèi)ibsqlite3.dylib和libsqlite3.dylib兩個(gè)庫稿茉,他們到底有什么區(qū)別呢?
libsqlite3.dylib本身是個(gè)鏈接,在這里它指向libsqlite3.0.dylib漓库。也就是說在這里你添加libsqlite3.dylib和添加libsqlite3.0.dylib其實(shí)是添加了同一個(gè)文件恃慧,沒有區(qū)別,那為什么要添加libsqlite3.dylib呢渺蒿?原因在于libsqlite3.dylib總是指向最新的sqlite3動(dòng)態(tài)庫痢士,也就是說如果出現(xiàn)了新的動(dòng)態(tài)庫(如:libsqlite3.1.dylib)那libsqlite3.dylib將指向這個(gè)新的動(dòng)態(tài)庫(libsqlite3.1.dylib)而不在是libsqlite3.0.dylib了!
6.does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target.
最近在新建工程想要進(jìn)行真機(jī)調(diào)試的時(shí)候發(fā)現(xiàn)報(bào)了這樣一個(gè)錯(cuò)誤茂装,這個(gè)是因?yàn)樵趚code7之后Xcode新增了一個(gè)功能就是給在程序打包的時(shí)候?qū)Τ绦蚶锩娴拇a進(jìn)行“瘦身”處理怠蹂。bitcode是被編譯程序的一種中間形式的代碼。包含bitcode配置的程序?qū)?huì)在App store上被編譯和鏈接少态。bitcode允許蘋果在后期重新優(yōu)化程序的二進(jìn)制文件城侧,而不需要重新提交一個(gè)新的版本到App store上。但是這就要求程序里面的所有第三方代碼都需要滿足支持bitcode况增。如果你還是想要保留這個(gè)第三方那么你可以在Xcode的”Build Settings”->”Enable Bitcode”選項(xiàng)中將其設(shè)置為NO。
7.控制器在跳轉(zhuǎn)的時(shí)候有push和modal兩種方式歧强,push多層的時(shí)候我們能夠用
[self.navigationController popToRootViewControllerAnimated:YES];來實(shí)現(xiàn)跳轉(zhuǎn)到根控制器摊册,但是你是否考慮過如果是modal的情況下怎么跨級(jí)跳轉(zhuǎn)呢茅特?
經(jīng)過一頓操作博主找到了以下方法:
//.presentingViewController能夠拿到跳轉(zhuǎn)到自己的ViewController白修,所以想跳多少層就跳多少層重斑,只要修改presentingViewController的個(gè)數(shù)窥浪。
//實(shí)驗(yàn)發(fā)現(xiàn)modal最底層是通過UITabBarController來實(shí)現(xiàn)的漾脂。- -
UIViewController *vc = self.presentingViewController.presentingViewController.presentingViewController;
[vc dismissViewControllerAnimated:YES completion:nil];
8.給大家分享幾個(gè)加密分類
百度云盤地址
密碼:8pkk
9.給大家分享一個(gè)比較詳細(xì)的地址plist文件骨稿。
百度云盤地址
密碼: rqr6
10:使用XIB可以加快開發(fā)速度,除了拖控件,還可以在XIB中直接把手勢添加到某個(gè)控件上面,剩下不少垃圾代碼的編寫,實(shí)在方便.但是,方便中有也有一些坑等著你踩.我習(xí)慣用[[[NSBundle mainBundle]loadNibNamed:NSStringFromClass([self class])owner:nil options:nil] lastObject]來加載XIB,所以,我遇到了一個(gè)坑,異常信息為:
reason: 'invalid nib registered for identifier (WMNearByFellowVCCellID) - nib must contain exactly one top level object which must be a UITableViewCell instance
再看下面的截圖,資深人士應(yīng)該知道原因了吧?
其實(shí),當(dāng)你在XIB中添加手勢(無論添加給誰),它就是一個(gè)文件的了,所以,你加載文件,就有可能加載到了手勢,而不是cell,所以就會(huì)出現(xiàn)上面的異常.
解決方式:使用[[[NSBundle mainBundle]loadNibNamed:NSStringFromClass([self class])owner:nil options:nil] firstObject]加載XIB,并且不能通過注冊的方式來做cell的循環(huán)利用.
最近發(fā)現(xiàn)一個(gè)問題形耗,我在xcode控制臺(tái)打印輸出的時(shí)候,并不能直接打印屬性的值了泰讽,這讓我很惆悵昔期,報(bào)錯(cuò)信息如下:
error: instance method 'left' has incompatible result types in different translation units ('CGFloat' (aka 'double') vs. 'MASViewAttribute *')
instance method 'left' also declared here
error: instance method 'top' has incompatible result types in different translation units ('CGFloat' (aka 'double') vs. 'MASViewAttribute *')
instance method 'top' also declared here
error: instance method 'right' has incompatible result types in different translation units ('CGFloat' (aka 'double') vs. 'MASViewAttribute *')
instance method 'right' also declared here
error: instance method 'bottom' has incompatible result types in different translation units ('CGFloat' (aka 'double') vs. 'MASViewAttribute *')
instance method 'bottom' also declared here
error: instance method 'width' has incompatible result types in different translation units ('CGFloat' (aka 'double') vs. 'MASViewAttribute *')
instance method 'width' also declared here
error: instance method 'height' has incompatible result types in different translation units ('CGFloat' (aka 'double') vs. 'MASViewAttribute *')
instance method 'height' also declared here
error: instance method 'centerX' has incompatible result types in different translation units ('CGFloat' (aka 'double') vs. 'MASViewAttribute *')
instance method 'centerX' also declared here
error: instance method 'centerY' has incompatible result types in different translation units ('CGFloat' (aka 'double') vs. 'MASViewAttribute *')
instance method 'centerY' also declared here
warning: property access result unused - getters should not be used for side effects
導(dǎo)致這個(gè)問題的原因我在網(wǎng)上找了好久硼一,網(wǎng)上大多說是分類里面有重復(fù)的方法導(dǎo)致了這個(gè)警告般贼,但是我發(fā)現(xiàn)舊版本就有分類方法名重名的情況但是卻并沒有報(bào)出這種錯(cuò)誤哼蛆,經(jīng)過對SVN版本號(hào)的對比我最終定位到了問題起源的版本號(hào),仔細(xì)對比代碼之后發(fā)現(xiàn)改過DEBUG_INFORMATION_FORMAT = dwarf;為DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
肥矢。這就是問題的根本所在甘改,只需要恢復(fù)配置為DEBUG_INFORMATION_FORMAT = dwarf;即可十艾。
下面是對于這兩個(gè)配置的官方說明:
DWARF - Object files and linked products will use DWARF as the debug information format. [dwarf]
DWARF with dSYM File - Object files and linked products will use DWARF as the debug information format, and Xcode will also produce a dSYM file containing the debug information from the individual object files (except that a dSYM file is not needed and will not be created for static library or object file products). [dwarf-with-dsym]