码迷,mamicode.com
首页 > 移动开发 > 详细

一些IOS开发中的小技巧

时间:2015-07-29 18:38:22      阅读:305      评论:0      收藏:0      [点我收藏+]

标签:

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"]

 

一些IOS开发中的小技巧

标签:

原文地址:http://www.cnblogs.com/try-wyh/p/4686558.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!