图片分类

@implementation UIImageView (ext)

+(UIImageView*)imageViewWith:(UIImage*)img imgFrame:(CGRect)_rect{

    UIImageView *imgView = [[[UIImageViewalloc] initWithFrame:_rect] autorelease];

    imgView.image = img;

    return imgView;

}

//图片拉绳 

+ (UIImageView *)imageViewForResizableImage:(UIImage *)image inRect:(CGRect)rect

{

    UIImageView *imageView = [[[UIImageViewalloc] initWithFrame:rect] autorelease];

    imageView.userInteractionEnabled = YES;

    if ([image respondsToSelector:@selector(resizableImageWithCapInsets:)]) {

        imageView.image = [image resizableImageWithCapInsets:UIEdgeInsetsMake(image.size.height/, image.size.width/, image.size.height/, image.size.width/)];

    } else {

        imageView.image = [image stretchableImageWithLeftCapWidth:image.size.width/ topCapHeight:image.size.height/];

    }

    return imageView;

}

@end
用block快速创建一个block 

+(XPNetWork*)shareNetWork{
static XPNetWork *network = NULL; static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
network = [[self alloc] init];
});
return network;
} UITableviewCell进行分组的
一个集合(NSArrary)包含多个个集合(NSArray addobject:nsarrary]。section
一个集合包含 多个字典( nsarrary add object :字典】 row 赋值的时候 //self.mydata是最大集合
NSArray *sectionArray=self.mydata[indexPath.section];//得到组 section
NSDictionary *resDic=sectionArray[indexPath.row];//得到row.
//通过字典进行赋值。
NSString *keySt = [NSString stringWithFormat:@"%@:",[[resDic allKeys] objectAtIndex:]];
NSString *valueSt = [[resDic allValues] objectAtIndex:];

ios中常用的方法的更多相关文章

  1. iOS中常用的四种数据持久化方法简介

    iOS中常用的四种数据持久化方法简介 iOS中的数据持久化方式,基本上有以下四种:属性列表.对象归档.SQLite3和Core Data 1.属性列表涉及到的主要类:NSUserDefaults,一般 ...

  2. ios中常用数据类型相互转换

    ios中常用数据类型相互转换 //1. NSMutableArray和NSArray互转 // NSArray转为NSMutableArray NSMutableArray *arrM = [arr ...

  3. iOS中的过期方法和新的替代方法

    关于iOS中的过期方法和新的替代方法 1.获取某些类的UINavigationBar的统一外观并设置UINavigationbar的背景 注:方法名改了但是基本使用方法不变 + (instancety ...

  4. org.apache.commons.lang.StringUtils中常用的方法

    org.apache.commons.lang.StringUtils中常用的方法,这里主要列举String中没有,且比较有用的方法: 1. 检查字符串是否为空: static boolean isB ...

  5. String对象中常用的方法

    String对象中常用的方法   1.charCodeAt方法返回一个整数,代表指定位置字符的Unicode编码.strObj.charCodeAt(index)说明:index将被处理字符的从零开始 ...

  6. 项目中常用js方法整理common.js

    抽空把项目中常用js方法整理成了common.js,都是网上搜集而来的,大家一起分享吧. var h = {}; h.get = function (url, data, ok, error) { $ ...

  7. String:(字符串)中常用的方法

    package stringyiwen; //字符串中常用的方法public class StringTest03 { public static void main(String[] args) { ...

  8. C语言中常用计时方法总结

    转自:http://blog.csdn.net/fz_ywj/article/details/8109368 C语言中常用计时方法总结 1. time() 头文件:time.h 函数原型:time_t ...

  9. iOS 中 常用的第三方库

    现在对于我们 iOS 开发来说,基本上说不可能不使用第三方轮子啦,毕竟没那么多时间,而且自己造的轮子往往想着成为上图中的最后一个,结果却成了上图中第二个或第一个啦,当然大公司另当别论.下面我从之前用过 ...

随机推荐

  1. MSSQL 数据库语句原来是区分大小写的啊

    一直以来我们都认为数据库语句是不区分大小写,其实这是错误的认识,之所以不区分是因为数据库语言不区分大小写.这里我们以mssql2005中自带的AdventureWorksDW数据库为例. 执行以下语句 ...

  2. 免费素材:气球样式的图标集(PSD, SVG, PNG)

    本地下载 一套30枚设计精良的气泡式圆形图标,两种款式供您选择,相信你会喜欢!

  3. maven 打包以及上传

    插件 ------------------------------------------------------------------------------------------------- ...

  4. ios Url Encode

    //ios Url Encode //有时候在请求的参数里里特殊符号比如“+”等.而如果没有encode的话那么传过去的还是” ”,面实际上是%2B. -(NSString*)UrlValueEnco ...

  5. WPF按钮删除默认的鼠标悬停效果

    <Style x:Key="NormalMouseButton" TargetType="Button"> <Setter Property= ...

  6. fdisk -l 参数详解

    [root@node1 ~]# fdisk -l Disk /dev/vda: 107.4 GB, 107374182400 bytes, 209715200 sectors // 扇区个数 Unit ...

  7. File /hbase could only be replicated to 0 nodes instead of minReplication (=1). There are 30 datanode(s) running and no node(s) are excluded in this operation.

    原因: hdfs-site.xml中的配置为: <property> <name>dfs.datanode.du.reserved</name> <value ...

  8. Warning: Divide by zero.

    问题:如标题 解决方案:分母加上+eps   参考自:http://www.ilovematlab.cn/thread-43128-1-1.html

  9. NGINX proxy_pass 域名解析问题

    前两天发现一个问题,当使用proxy_pass的时候,发现域名对应IP是缓存的,这样一旦VIP变化之后,就会报错,下面就来详细分析一下这个问题. 一.问题说明 location = /test { i ...

  10. 算法笔记_202:第三届蓝桥杯软件类决赛真题(Java高职)

    目录 1 填算式 2 提取子串 3 机器人行走 4 地址格式转换 5 排日程   前言:以下代码仅供参考,若有错误欢迎指正哦~ 1 填算式 [结果填空] (满分11分) 看这个算式: ☆☆☆ + ☆☆ ...