码迷,mamicode.com
首页 >  
搜索关键字:NSArray    ( 1675个结果)
在代码里更新autolayout布局
1 //遍历view约束(高,宽) 2 NSArray* constrains = self.View.constraints; 3 for (NSLayoutConstraint* constraint in constra...
分类:其他好文   时间:2015-04-21 17:54:20    阅读次数:130
选择排序 //插入排序 //快速排序
-(void)selectSortWithArray:(NSArray *)aData{     NSMutableArray *data = [[NSMutableArray alloc]initWithArray:aData];     for (int i=0; i         int m =i;         for (int j =i+1; j             i...
分类:编程语言   时间:2015-04-21 16:13:03    阅读次数:141
iOS 根据文件名获取到文件路径
根据文件名来获取文件路径(Document目录下)//根据文件名来获取文件路径 - (NSString *)dataFilePath:(NSString *)sender { NSArray *path = NSSearchPathForDirectoriesInDomains(NSDo...
分类:移动开发   时间:2015-04-21 14:22:28    阅读次数:135
NSArray、NSDictionary 转成 JSONString
1.NSArray转换成JSONString //NSArray+JSONString.h@interface NSArray (JSONString)- (NSString *)jsonStringWithPrettyPrint:(BOOL)prettyPrint;@end@implementat...
分类:Web程序   时间:2015-04-21 01:45:20    阅读次数:119
ios开发笔记根据传入字符串的长度动态生成label,并按照屏幕宽度排列
在开发工作中遇到了一个对我来说非常难得问题,搞了两天呀,都虚脱了,终于骗到大神给的demo做了出来效果是这样首先后台的同事传一个字符串。。拒绝传数组,那么我们就要学会分割!NSString *tagStr = [dictionary valueForKey:@"tags"];NSArray *sta...
分类:移动开发   时间:2015-04-20 20:53:50    阅读次数:214
判断获取的是否是前置摄像头
- (AVCaptureDevice *)getFrontCamera{ //获取前置摄像头设备 //过AVCaptureDevice的类方法devices或devicesWithMediaType去获取全部或局部设备列表 NSArray *cameras = [AVCapture...
分类:其他好文   时间:2015-04-20 12:55:04    阅读次数:177
oc UI输入数字n创建n条彩虹 IMP
RainBow.m #import "RainBow.h" @implementation RainBow {     NSArray * _colorArray; } -(instancetype)initWithFrame:(CGRect)frame withNum:(NSInteger) num{...
分类:其他好文   时间:2015-04-16 20:01:29    阅读次数:120
Objective-c中对象的Copy、MutableCopy、浅拷贝、深拷贝
对象的复制就是复制一个对象作为副本,他会开辟一块新的内存(堆内存)来存储副本对象,就像复制文件一样,即源对象和副本对象是两块不同的内存区域。对象要具备复制功能,必须实现协议或者协议,常用的可复制对象有:NSNumber、NSString、NSMutableString、NSArray、NSMutableArray、NSDictionary、NSMutableDictionary copy:产...
分类:其他好文   时间:2015-04-16 17:42:02    阅读次数:153
【iOS开发】数据持久化之plist存储
**plist文件其实就是XML文档,只是后缀名为plist。如果对象是NSString、NSDictionary、NSArray、NSData、NSNumber等类型,就可以使用writeToFile:atomically:方法直接将对象写到属性列表文件中 **关于plist文件的写入- (void)saveArray { // 1.获得沙盒根路径 NSString *home...
分类:移动开发   时间:2015-04-16 15:45:57    阅读次数:142
颜色(数字)随机 -- 不重复
+ (NSArray *)randomColors {// NSMutableArray *startColors = [NSMutableArray arrayWithObjects:randomColor1,randomColor2,randomColor3,randomColor4,rand....
分类:其他好文   时间:2015-04-16 13:52:41    阅读次数:90
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!