ios中常用的方法
图片分类 @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中常用的方法的更多相关文章
- iOS中常用的四种数据持久化方法简介
iOS中常用的四种数据持久化方法简介 iOS中的数据持久化方式,基本上有以下四种:属性列表.对象归档.SQLite3和Core Data 1.属性列表涉及到的主要类:NSUserDefaults,一般 ...
- ios中常用数据类型相互转换
ios中常用数据类型相互转换 //1. NSMutableArray和NSArray互转 // NSArray转为NSMutableArray NSMutableArray *arrM = [arr ...
- iOS中的过期方法和新的替代方法
关于iOS中的过期方法和新的替代方法 1.获取某些类的UINavigationBar的统一外观并设置UINavigationbar的背景 注:方法名改了但是基本使用方法不变 + (instancety ...
- org.apache.commons.lang.StringUtils中常用的方法
org.apache.commons.lang.StringUtils中常用的方法,这里主要列举String中没有,且比较有用的方法: 1. 检查字符串是否为空: static boolean isB ...
- String对象中常用的方法
String对象中常用的方法 1.charCodeAt方法返回一个整数,代表指定位置字符的Unicode编码.strObj.charCodeAt(index)说明:index将被处理字符的从零开始 ...
- 项目中常用js方法整理common.js
抽空把项目中常用js方法整理成了common.js,都是网上搜集而来的,大家一起分享吧. var h = {}; h.get = function (url, data, ok, error) { $ ...
- String:(字符串)中常用的方法
package stringyiwen; //字符串中常用的方法public class StringTest03 { public static void main(String[] args) { ...
- C语言中常用计时方法总结
转自:http://blog.csdn.net/fz_ywj/article/details/8109368 C语言中常用计时方法总结 1. time() 头文件:time.h 函数原型:time_t ...
- iOS 中 常用的第三方库
现在对于我们 iOS 开发来说,基本上说不可能不使用第三方轮子啦,毕竟没那么多时间,而且自己造的轮子往往想着成为上图中的最后一个,结果却成了上图中第二个或第一个啦,当然大公司另当别论.下面我从之前用过 ...
随机推荐
- Scramble String leetcode java
题目: Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty subs ...
- [置顶] Hadoop2.2.0中HDFS的高可用性实现原理
在Hadoop2.0.0之前,NameNode(NN)在HDFS集群中存在单点故障(single point of failure),每一个集群中存在一个NameNode,如果NN所在的机器出现了故障 ...
- 使用矩阵分解(SVD)实现推荐系统
http://ling0322.info/2013/05/07/recommander-system.html 这个学期Web智能与社会计算的大作业就是完成一个推荐系统参加百度电影推荐算法大赛,成绩按 ...
- Mahout初体验
Mahout运行版本: mahout-0.5, mahout-0.6, mahout-0.7,是基于hadoop-0.20.2x的. mahout-0.8, mahout-0.9,是基于hadoop- ...
- javascript——选择行之后才可以进行控制操作
- Python 编码风格指南
原文:http://python.jobbole.com/84618/ 本文超出 PEP8 的范畴以涵盖我认为优秀的 Python 风格.本文虽然坚持己见,却不偏执.不仅仅涉及语法.模块布局等问题,同 ...
- JavaScript Array 对象常用方法
<script type="text/javascript"> //shift:删除原数组的第一项,返回删除元素的值:如果数组为空则返回undefined var ar ...
- bash和shell的关系
bash是borne again shell的缩写,它是shell的一种,Linux上默认采用的是bash. shell脚本中的方法带不带function的区别,例如: function foo () ...
- 微信小程序 - radio/checkbox自定义组件
更新 2019-01-26:首次发布 2019-01-27:增加默认取值选中radio/checkbox,checkbox需在onload取值 2019-01-28:增加radio取值不存在红色提示和 ...
- spring-boot 实现文件上传下载
@Controller public class FileUploadCtrl { @Value("${file.upload.dir}") private String path ...