一些IOS开发中的小技巧
1.打包后提交報錯誤
? ? 錯誤信息:ERROR ITMS-90035: "Invalid Signature. Code object is not signed at all. The binary at path
? ? ? ? ? ? ? ? ? [******.app/build-libidn.sh]?
? ?解決方案:在Archive 界面上 選擇剛生成的那個app 右鍵 Show in Finder? 顯示包含內容-》Products->Application->應用
? ? ? ? ? ? ? ? ?右鍵顯示包含內容,找到文件 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 的意義
? ?這個函數接收一個CGrect,dx,和dy 返回一個CGRect 返回的CGRect 是根據傳入的CGRect和dx,dy來決定的,dx,dy 決定了放大還是縮小傳入的CGrect的寬高,正數為縮小,
? ?負數為增大CGRectInset(rect,0,20) 這個是說明rect高度縮小20 但是中心點還是和原來的CGRect 一樣。
6.CGRectOffset的意義
? 這個函數接收一個CGrect dx,和dy 返回一個CGRect 返回的CGRect 是根據傳入的CGRect和dx,dy來決定的,dx為正數 原CGRect整體向右偏移,負數反之,dy為正數
?原CGRect整體向下偏移,負數反之, CGRectOffset (rect,0,20) 這個是說明原CGRect像下偏移20像素
7.CocosPod 的安裝和使用
?參考這個鏈接內容:http://blog.csdn.net/wzzvictory/article/details/18737437
8.如何打包測試安裝包,給真機測試機安裝
直接在Xcode里面build工程生成APP,打開生成app的路徑把APP拖入iTunes 即可導出測試安裝用的ipa安裝包,把ipa包給測試用戶,
用戶使用iTunes 同步到手機實現模擬上線后在線升級的情況。
9.如何設置統一的導航欄背景顏色顏色
?新建一個繼承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 設置導航欄和狀態欄的背景顏色天貓紅 [self.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil]];} - (UIStatusBarStyle)preferredStatusBarStyle{return UIStatusBarStyleLightContent;//設置狀態欄字體為白色的 }10.使用AFNetworking 出現報錯
? ?錯誤信息: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"]?
轉載于:https://www.cnblogs.com/try-wyh/p/4686558.html
總結
以上是生活随笔為你收集整理的一些IOS开发中的小技巧的全部內容,希望文章能夠幫你解決所遇到的問題。
                            
                        - 上一篇: 新开通博客园,纪念一下。
 - 下一篇: Angular5 *ngIf 和 hid