一些IOS开发中的小技巧
1.打包后提交報(bào)錯(cuò)誤
? ? 錯(cuò)誤信息:ERROR ITMS-90035: "Invalid Signature. Code object is not signed at all. The binary at path
? ? ? ? ? ? ? ? ? [******.app/build-libidn.sh]?
? ?解決方案:在Archive 界面上 選擇剛生成的那個(gè)app 右鍵 Show in Finder? 顯示包含內(nèi)容-》Products->Application->應(yīng)用
? ? ? ? ? ? ? ? ?右鍵顯示包含內(nèi)容,找到文件 build-libidn.sh 刪除 重新提交就可以了
2.IOS Tabbar 擋住了tableview? 半行差不多?
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0){self.edgesForExtendedLayout = UIRectEdgeNone;self.extendedLayoutIncludesOpaqueBars = NO;self.modalPresentationCapturesStatusBarAppearance = NO;self.automaticallyAdjustsScrollViewInsets = YES; }?3.IOS7 Tableview Group模式頂部有空白
self.tableview.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, self.tableview.bounds.size.width, 0.01f)];4.Tableview 底部多余的分割線
tableview.tableFooterView = [[UIView alloc]init];5.CGRectInset 的意義
? ?這個(gè)函數(shù)接收一個(gè)CGrect,dx,和dy 返回一個(gè)CGRect 返回的CGRect 是根據(jù)傳入的CGRect和dx,dy來決定的,dx,dy 決定了放大還是縮小傳入的CGrect的寬高,正數(shù)為縮小,
? ?負(fù)數(shù)為增大CGRectInset(rect,0,20) 這個(gè)是說明rect高度縮小20 但是中心點(diǎn)還是和原來的CGRect 一樣。
6.CGRectOffset的意義
? 這個(gè)函數(shù)接收一個(gè)CGrect dx,和dy 返回一個(gè)CGRect 返回的CGRect 是根據(jù)傳入的CGRect和dx,dy來決定的,dx為正數(shù) 原CGRect整體向右偏移,負(fù)數(shù)反之,dy為正數(shù)
?原CGRect整體向下偏移,負(fù)數(shù)反之, CGRectOffset (rect,0,20) 這個(gè)是說明原CGRect像下偏移20像素
7.CocosPod 的安裝和使用
?參考這個(gè)鏈接內(nèi)容:http://blog.csdn.net/wzzvictory/article/details/18737437
8.如何打包測(cè)試安裝包,給真機(jī)測(cè)試機(jī)安裝
直接在Xcode里面build工程生成APP,打開生成app的路徑把APP拖入iTunes 即可導(dǎo)出測(cè)試安裝用的ipa安裝包,把ipa包給測(cè)試用戶,
用戶使用iTunes 同步到手機(jī)實(shí)現(xiàn)模擬上線后在線升級(jí)的情況。
9.如何設(shè)置統(tǒng)一的導(dǎo)航欄背景顏色顏色
?新建一個(gè)繼承UINavigationController 的子類
- (void)viewWillAppear:(BOOL)animated{[self.navigationBar setTintColor:[UIColor whiteColor]];[self.navigationBar setBarTintColor:[UIColor colorWithRed:151.0/255.0 green:1.0/255.0 blue:2.0/255.0 alpha:1.0]]; //IOS7 設(shè)置導(dǎo)航欄和狀態(tài)欄的背景顏色天貓紅 [self.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil]];} - (UIStatusBarStyle)preferredStatusBarStyle{return UIStatusBarStyleLightContent;//設(shè)置狀態(tài)欄字體為白色的 }10.使用AFNetworking 出現(xiàn)報(bào)錯(cuò)
? ?錯(cuò)誤信息:Error: Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html
? ?解決方案:
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"]?
轉(zhuǎn)載于:https://www.cnblogs.com/try-wyh/p/4686558.html
總結(jié)
以上是生活随笔為你收集整理的一些IOS开发中的小技巧的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 新开通博客园,纪念一下。
- 下一篇: Angular5 *ngIf 和 hid