摘要: //创建单例 @interface Singleton : NSObject  @property (retain,nonatomic) NSString *info; +(instancetype)shareInstance;  @end   //单例实现 @implementation Sing 阅读全文
posted @ 2016-03-15 21:14 原码 阅读(225) 评论(0) 推荐(0) 编辑
摘要: #define HEIGHT  self.view.frame.size.height #define WIDTH    self.view.frame.size.width   @interface ViewController : UIViewController<UIScrollViewDel 阅读全文
posted @ 2016-03-14 21:44 原码 阅读(123) 评论(0) 推荐(0) 编辑
摘要: @property (strong,nonatomic) UIPickerView *pickerV; @property (strong,nonatomic) NSArray *arr; @property (strong,nonatomic) NSMutableArray *arrCity; @ 阅读全文
posted @ 2016-03-12 19:09 原码 阅读(131) 评论(0) 推荐(0) 编辑
摘要: int i; @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; self.myScrollV = [[UIScrollView all 阅读全文
posted @ 2016-03-11 21:37 原码 阅读(132) 评论(0) 推荐(0) 编辑
摘要: //label自适应 self.label = [UILabel new]; self.label.font = [UIFont systemFontOfSize:14]; NSString *titleContent = @"亲,欢迎您通过以下方式与我们的营销顾问取得联系,交流您再营销推广工作中遇 阅读全文
posted @ 2016-03-10 21:52 原码 阅读(146) 评论(0) 推荐(0) 编辑
摘要: //将图形设置成圆形 //初始化并设label frame UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(100, 100, 100, 100)]; //设置四角的半径 cornerRadius label.layer.corn 阅读全文
posted @ 2016-03-09 20:33 原码 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 1、属性传值 前向后传值。 记住: /* 1: 属性传值第一步需要用到什么类型就定义什么样的属性 2: 从上一个页面到一个页面的选中方法里面将要传的值传到来(上一个页面)备注:这种方法只适用于上一个页面推到下一个页面 */ MainViewController与SecondViewControlle 阅读全文
posted @ 2016-03-08 22:12 原码 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 改变占位符的颜色 UIColor *placeHolderTextColor = [UIColor redColor]; CGSize drawSize = [self.placeholder sizeWithAttributes:[NSDictionary dictionaryWithObject 阅读全文
posted @ 2016-03-07 21:48 原码 阅读(111) 评论(0) 推荐(0) 编辑
摘要: @class 只说明有这个类,用的时候还必须导入头文件 防止循环应用(你中有我,我中有你。相互应用)。 #import :防止了头文件重复导入 #include :需要什么头文件就包含什么头文件,不会去检查有没这个文件,所以不能防止重复导入 延展 为类创建私有方法 实现一对多 一个.m 多个.h 方 阅读全文
posted @ 2016-03-06 20:19 原码 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 1、栈区(stack)— 由编译器自动分配释放 ,存放函数的参数值,局部变量的值等。其操作方式类似于数据结构中的栈。 2、堆区(heap) — 一般由程序员分配释放 , 若程序员不释放,程序结束时可能由OS回收 。注意它与数据结构中的堆是两回事,分配方式倒是类似于链表。 3、全局区(静态区)(sta 阅读全文
posted @ 2016-03-05 21:43 原码 阅读(115) 评论(0) 推荐(0) 编辑