随笔分类 - IOS Self Study
摘要:1 协议,就是class里面必须遵循的约定。例如@protocol viewControllerDelegate -(void)loadMoreData;@end@interface ViewController ()@property (weak, nonatomic) IBOutlet UITa...
阅读全文
摘要:1accessoryTypetypedef NS_ENUM(NSInteger, UITableViewCellAccessoryType) { UITableViewCellAccessoryNone, // don't show any accessor...
阅读全文
摘要://// heroObject.m// herosList//// Created by xin on 15/4/9.// Copyright (c) 2015年 Jackey. All rights reserved.//#import "heroObject.h"@implementat...
阅读全文
摘要:1 tableView 1.1设置组-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ return self.carGroups.count;} 1.2 设置行-(NSInteger)tableView:(UIT...
阅读全文
摘要:1 delegate 代理@protocol AppInfoViewClassDelegate -(void)appInfoViewDownLoad:(AppInfoViewClass *)appInfoView;@end@property (nonatomic,weak) id delegate;...
阅读全文
摘要:1 UIScrollView 与 delegate的通讯 1.1 用户开始拖拽时,调用scrollViewWillBeginDragging 1.2 具体滚动到某个位置,调用scrollViewDidScroll 1.3 调用scrollViewDidEndDragging:willDecelera...
阅读全文
摘要:1 scrollViewself.scrollView.contentSize = self.imageView.frame.size;//self.scrollView.contentOffset = CGPointMake(0.f, -20.f);//scrollView滚动的位置self.sc...
阅读全文
摘要:1 延迟执行函数[self performSelector:@selector( nextQuestion) withObject:nil afterDelay:0.5];2 应用名称国际化(1)项目-》Proje...
阅读全文
摘要:1 kvckey value coding-(instancetype)initWithDict:(NSDictionary *)dict{ self = [super init]; if (self) {// self.answer = dict[@"answer"];/...
阅读全文
摘要:1 改变状态栏(手机屏幕最上面的状态栏,电池时间那个栏目)/** modify status bar */-(UIStatusBarStyle)preferredStatusBarStyle{ return UIStatusBarStyleLightContent;}2 增加蒙板的写法/** ...
阅读全文
摘要:1 工厂方法- (instancetype)initWithDict:(NSDictionary *)dict{ self = [super init]; if (self) { self.name = dict[@"name"]; self.icon = d...
阅读全文
摘要://// ViewController.m// AppManager//// Created by xin on 15-3-16.// Copyright (c) 2015年 Jackey. All rights reserved.//#import "ViewController.h"//...
阅读全文
摘要://// ViewController.m// AppManager//// Created by xin on 15-3-16.// Copyright (c) 2015年 Jackey. All rights reserved.//#import "ViewController.h"//...
阅读全文
摘要:1 Strong and Weak#import "Person.h"@implementation Person- (void)dealloc{ NSLog(@"person destroy");}@end强指针:strong系统一般不会自动释放弱指针:weak 系统会立即释放对象//// ...
阅读全文
摘要://// ViewController.m// TomCat//// Created by xin on 15-3-15.// Copyright (c) 2015年 Jackey. All rights reserved.//#import "ViewController.h"@inter...
阅读全文
摘要:这是一个图片浏览的程序,是传智公开课的一个demo代码如下//// ViewController.m// ImageBroswer//// Created by xin on 15-3-12.// Copyright (c) 2015年 Jackey. All rights reserved...
阅读全文
摘要:1 注释的一个小技巧, 使用 /** */ 会在使用该方式的时候得到提示/** 改变图像数据 */-(void)changeImage{}2 assign 声明变量//assign:指定setter方法用简单的赋值,这是默认操作。你可以对标量类型(如int)使用这个属性。//你可以想象一个float...
阅读全文
摘要:1 Button 手写代码生产的方式-(void)viewDidLoad{ [super viewDidLoad]; UIButton *btn = [[UIButton alloc]init]; btn.frame = CGRectMake(0, 100, 100, 10...
阅读全文
摘要:1 CGRect frame控件所在矩形框在父控件中的位置和尺寸(以父控件的左上角为坐标原点)可以定义控件的位置(origin)和大小(size)2 CGRect bounds控件所在矩形框的位置和尺寸(以自己左上角为坐标原点,所以Bounds的x,y一般为0)可以定义控件的大小(size)3 CG...
阅读全文
浙公网安备 33010602011771号