随笔分类 - 【笔记】
摘要:一、runtime简介 • RunTime简称运行时。OC就是运行时机制,也就是在运行时候的一些机制,其中最主要的是消息机制。 • 对于C语言,函数的调用在编译的时候会决定调用哪个函数。 • 对于OC的函数,属于动态调用过程,在编译的时候并不能决定真正调用哪个函数,只有在真正运行的时候才会根据函数的
阅读全文
摘要:1.流程 2.文档地址:https://doc.open.alipay.com/doc2/detail.htm?spm=a219a.7629140.0.0.YX8QCY&treeId=59&articleId=103675&docType=1 2.1 从官方demo中导入支付宝库 2.2 导入系统依
阅读全文
摘要:0、请写出代码,用blocks来取代上例中的protocol,并比较两种方法的优势。实际应用部分?请写出代码,用blocks取代协议或回调方法 声明: #import <Foundation/Foundation.h> typedef void(^TestBlock)(NSString *strin
阅读全文
摘要:1、 描述应用程序的启动顺序。 1、程序入口main函数创建UIApplication实例和UIApplication代理实例 2、在UIApplication代理实例中重写启动方法,设置第一ViewController 3、在第一ViewController中添加控件,实现对应的程序界面。 2.为
阅读全文
摘要:1、 简述OC中内存管理机制。与retain配对使用的方法是dealloc还是release,为什么?需要与alloc配对使用的方法是dealloc还是release,为什么?readwrite,readonly,assign,retain,copy,nonatomic 、atomic、strong
阅读全文
摘要:1.__block和__weak修饰符的区别: 1.__block不管是ARC还是MRC模式下都可以使用,可以修饰对象,还可以修饰基本数据类型。 2.__weak只能在ARC模式下使用,也只能修饰对象(NSString),不能修饰基本数据类型(int)。 3.__block对象可以在block中被重
阅读全文
摘要:NSString *sourcePath = [[NSBundle mainBundle]resourcePath];
阅读全文
摘要:UISwitch *swh = [[UISwitch alloc]initWithFrame:CGRectMake(100,100, 50, 30)]; swh.on = YES; [swh addTarget:self action:@selector(switchAction:) forCon...
阅读全文
摘要:在[self addsubView:xxx]中,self.name 和 _name的区别self.name 会调用重写的getter方法,而_name添加的只是_name 这个成员变量
阅读全文
摘要:[bottomButton setTitleEdgeInsets:UIEdgeInsetsMake(10, -190, 10, 44)]; //上左下右 ||button.contentVerticalAlignment = UIControlContentVerticalAlignmentBo...
阅读全文
摘要:[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"back_image.jpg"] forBarMetrics:UIBarMetricsDefault];
阅读全文
摘要:UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"开始录制!" message:nil preferredStyle:UIAlertControllerStyleAlert]; UIA...
阅读全文
摘要:@synthesize 相当于把属性当成成员变量来用,不用再写self.属性@synthesize myButton; 这样写了之后,那么编译器会自动生成myButton的实例变量,以及相应的getter和setter方法。注意:_myButton这个实例变量是不存在的,因为自动生成的实例变量为m...
阅读全文
摘要:选中右键->Services->Reveal in finder
阅读全文
摘要:self performSelector: withObject: afterDelay:延迟事件再推出viewcontroller时要注意//取消所有延迟事件 [NSObject cancelPreviousPerformRequestsWithTarget:self];
阅读全文
摘要:CGFloat :在mac上自适应,在64位的系统,会变宽,32位会变窄,手机没变化float:没有变化
阅读全文
摘要:cell.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@“图片名”]];
阅读全文
摘要:[self.navigationController.navigationBar setTitleTextAttributes: @{NSFontAttributeName:[UIFont systemFontOfSize:19], NSForegroundColorAttributeName...
阅读全文
摘要:/** * 内存管理基本原则(没有看到这几个关键词时,alloc,copy,retain,没有拥有对象的所有权) * 只有通过那几个关键词,才需要手动release */
阅读全文