CocoaPods 使用問題
需要在原工程的other link flags配置中增加$(inherited)漆际,否則pod install 時會報警告淆珊,因為會導(dǎo)致pod工程的配置不會同步到原工程夺饲。但是如果原工程中引用的framework不能支持-Objc,則會在鏈接時報重復(fù)的符號錯誤,此時需要把pod自動生成的-Objc參數(shù)替換成force_load形式往声,參見8pig工程中的podfile擂找。
jenkins集成時,需要配置Xcode Workspace File為pod的工作區(qū)文件${WORKSPACE}/EightTrip浩销,并且Target要設(shè)置為空贯涎。
參考:
http://www.reibang.com/p/35918eabc380
http://www.reibang.com/p/7a2efc7c69fe
https://stackoverflow.com/questions/30244675/how-can-i-modify-other-ldflags-via-cocoapods-post-install-hook
JSPatch基礎(chǔ)使用
js文件要記得保存為UTF8格式,否則會報一個未知的錯誤
枚舉類型要轉(zhuǎn)換成數(shù)字
masonry make中的各個屬性其實是返回的block所以要在使用時加()調(diào)用慢洋,如:
switchModeButton.mas__makeConstraints(block("void, MASConstraintMaker*", function(make) {
make.left().equalTo()(footerView).offset()(40);
make.right().equalTo()((footerView)).offset()(-40);
make.height().equalTo()(44);
make.centerY().equalTo()(footerView);
}));
- block的傳遞塘雳,在 Objective-C 中傳入到 JSPatch 中的 Block 會轉(zhuǎn)換為 function,如果需要再將該 Block 傳回到 OC普筹,需要用block(paramTypes, function)封裝败明。
如:
AliOssEngine.sharedInstance().uploadImage_remoteFolder_completeBlock(normalizedImage, remoteFolder, **block("ImageModel *, NSError *", completeBlock)**);
http://www.cocoachina.com/ios/20161202/18264.htm
5.Can't find variable: ocat34,沒有require相關(guān)的類
- CGRect 和 CGPoint之類的寫法
self.valueForKey("_tableView").setFrame({x:0, y:20, width:UIScreen.mainScreen().bounds().width - 20, height:self.frame().height -20});
[label setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal] 設(shè)置文本寬度抗壓參數(shù)
http://www.cocoachina.com/ios/20160808/17305.html
OC內(nèi)存磁盤緩存第三方庫 YYCache
UINavigationController修改頁面棧方法
varcontrollerArr = self.navigationController?.viewControllers//獲取Controller數(shù)組
controllerArr?.removeAll()//移除controllerArr中保存的歷史路徑
//重新添加新的路徑
controllerArr?.append(self.navigationController?.viewControllers[0])
controllerArr?.append(C)
//將組建好的新的跳轉(zhuǎn)路徑 set進self.navigationController里
self.navigationController?.setViewControllers(controllerArr!, animated:true)//這里直接setViewControllers即可太防,不需要push或者pop方法
http://www.cocoachina.com/ios/20160805/17302.html
UISearchController 在 UITableView 中實現(xiàn)搜索條妻顶,push VC后searchbar依然顯示的問題解決
http://www.cocoachina.com/ios/20160805/17298.html
KVO、notification免移除實現(xiàn)方法XWEasyKVONotification
源碼和插件集合http://www.cocoachina.com/ios/20160719/17078.html
編寫高質(zhì)量iOS與OS X代碼的52個有效方法
http://www.cocoachina.com/ios/20160607/16627.html
富文本常用封裝(NSAttributedString)
http://www.cocoachina.com/ios/20160823/17409.html
SwipeTableView:頁面內(nèi)支持上下左后切換列表布局效果
http://www.cocoachina.com/ios/20160812/17346.html
如何使得能夠在itunes中的apps共享中看到document文件
plist設(shè)置uifilesharingenabled=true蜒车,但是蘋果可能審核不過
Xcode 下載地址:
http://developer.apple.com/download/more