//一: 迭代器 //数组 NSArray *arr=@[@"1",@"2",@"3",@"4",@"5"]; NSEnumerator *enumerator = [arr objectEnumerator]; NSString *str = nil; while (str = [enumerat ...
分类:
其他好文 时间:
2017-06-04 17:02:34
阅读次数:
133
一、NSRangeNSRange的定义:typedef struct _NSRange { NSUInteger location; NSUInteger length; } NSRange;NSRanage的使用: NSRange range = NSMakeRange(8, 10); NSLog ...
分类:
其他好文 时间:
2017-05-28 20:50:33
阅读次数:
153
1、保存图片和方向 [userDefault setObject:UIImagePNGRepresentation(image) forKey:udUserImage]; [userDefault setObject:[NSNumber numberWithInteger:image.imageOr ...
分类:
移动开发 时间:
2017-05-27 15:21:54
阅读次数:
273
之前求数组中某个数中的最大值与最小值。还真一个个比較,后来看到这种方法后,我就醉了 NSArray *testArray = [NSArray arrayWithObjects:@"-2.0", @"2.3", @"3.0", @"4.0", nil]; NSNumber *sum = [testA ...
分类:
移动开发 时间:
2017-05-26 19:01:02
阅读次数:
371
NSDictionary、NSMutableDictionary的基本用法 1.不可变词典NSDictionary 字典初始化 NSNumber *numObj = [NSNumber numberWithInt:100]; 以一个元素初始化 NSDictionary *dic = [NSDicti ...
分类:
移动开发 时间:
2017-05-17 14:07:10
阅读次数:
193
一、MRC 与 ARC 各自的属性修饰符 二、内存管理修饰符 MRC 模式下属性修饰符 retain: 引用计数加1。 assign: 分配内存,类似于copy。常用于基本数据类型,比如:int,long,NSInteger等。 ARC 模式下属性修饰符 weak: 当引用计数为零时,将其置为nil ...
分类:
其他好文 时间:
2017-05-07 15:39:37
阅读次数:
146
ViewController.h #import <UIKit/UIKit.h> @interface ViewController : UIViewController { UIImage *_image; NSInteger _index; } @endViewController.m #imp ...
分类:
其他好文 时间:
2017-05-01 14:20:01
阅读次数:
148
UIApplication简介: 利用UIApplication对象能进行一些应用级别的操作。 设置应用程序图标右上角的红色提醒数字 @property(nonatomic) NSInteger applicationIconBadgeNumber; //代码实现和效果 UIApplication ...
分类:
移动开发 时间:
2017-04-25 13:24:52
阅读次数:
332
/* 5 依据输入的内容打印出菱形 */ +(void)print:(NSInteger)count blankString:(NSString*)blankString flagString:(NSString*)flagString /* { NSMutableString * ptr = [[ ...
分类:
其他好文 时间:
2017-04-25 10:07:51
阅读次数:
187
手势识别状态: typedef NS_ENUM(NSInteger, UIGestureRecognizerState) { // 没有触摸事件发生,所有手势识别的默认状态 UIGestureRecognizerStatePossible, // 一个手势已经开始但尚未改变或者完成时 UIGestu ...
分类:
移动开发 时间:
2017-04-15 20:45:35
阅读次数:
206