摘要: 一、runtime简介 • RunTime简称运行时。OC就是运行时机制,也就是在运行时候的一些机制,其中最主要的是消息机制。 • 对于C语言,函数的调用在编译的时候会决定调用哪个函数。 • 对于OC的函数,属于动态调用过程,在编译的时候并不能决定真正调用哪个函数,只有在真正运行的时候才会根据函数的 阅读全文
posted @ 2016-04-14 17:28 Bo-tree 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 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 导入系统依 阅读全文
posted @ 2016-04-14 14:45 Bo-tree 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 0、请写出代码,用blocks来取代上例中的protocol,并比较两种方法的优势。实际应用部分?请写出代码,用blocks取代协议或回调方法 声明: #import <Foundation/Foundation.h> typedef void(^TestBlock)(NSString *strin 阅读全文
posted @ 2016-04-13 20:22 Bo-tree 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 1、 描述应用程序的启动顺序。 1、程序入口main函数创建UIApplication实例和UIApplication代理实例 2、在UIApplication代理实例中重写启动方法,设置第一ViewController 3、在第一ViewController中添加控件,实现对应的程序界面。 2.为 阅读全文
posted @ 2016-04-09 13:33 Bo-tree 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 1、 简述OC中内存管理机制。与retain配对使用的方法是dealloc还是release,为什么?需要与alloc配对使用的方法是dealloc还是release,为什么?readwrite,readonly,assign,retain,copy,nonatomic 、atomic、strong 阅读全文
posted @ 2016-04-08 17:16 Bo-tree 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 1.__block和__weak修饰符的区别: 1.__block不管是ARC还是MRC模式下都可以使用,可以修饰对象,还可以修饰基本数据类型。 2.__weak只能在ARC模式下使用,也只能修饰对象(NSString),不能修饰基本数据类型(int)。 3.__block对象可以在block中被重 阅读全文
posted @ 2016-04-08 15:01 Bo-tree 阅读(140) 评论(0) 推荐(0) 编辑
摘要: NSString *sourcePath = [[NSBundle mainBundle]resourcePath]; 阅读全文
posted @ 2016-01-26 19:46 Bo-tree 阅读(148) 评论(0) 推荐(0) 编辑
摘要: UISwitch *swh = [[UISwitch alloc]initWithFrame:CGRectMake(100,100, 50, 30)]; swh.on = YES; [swh addTarget:self action:@selector(switchAction:) forCon... 阅读全文
posted @ 2016-01-26 19:06 Bo-tree 阅读(612) 评论(0) 推荐(0) 编辑
摘要: 在[self addsubView:xxx]中,self.name 和 _name的区别self.name 会调用重写的getter方法,而_name添加的只是_name 这个成员变量 阅读全文
posted @ 2016-01-26 19:05 Bo-tree 阅读(214) 评论(0) 推荐(0) 编辑
摘要: [bottomButton setTitleEdgeInsets:UIEdgeInsetsMake(10, -190, 10, 44)]; //上左下右 ||button.contentVerticalAlignment = UIControlContentVerticalAlignmentBo... 阅读全文
posted @ 2016-01-26 19:04 Bo-tree 阅读(250) 评论(0) 推荐(0) 编辑
摘要: [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"back_image.jpg"] forBarMetrics:UIBarMetricsDefault]; 阅读全文
posted @ 2016-01-26 19:04 Bo-tree 阅读(504) 评论(0) 推荐(0) 编辑
摘要: UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"开始录制!" message:nil preferredStyle:UIAlertControllerStyleAlert]; UIA... 阅读全文
posted @ 2016-01-26 19:03 Bo-tree 阅读(174) 评论(0) 推荐(0) 编辑
摘要: @synthesize 相当于把属性当成成员变量来用,不用再写self.属性@synthesize myButton; 这样写了之后,那么编译器会自动生成myButton的实例变量,以及相应的getter和setter方法。注意:_myButton这个实例变量是不存在的,因为自动生成的实例变量为m... 阅读全文
posted @ 2016-01-26 19:02 Bo-tree 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 选中右键->Services->Reveal in finder 阅读全文
posted @ 2016-01-26 19:01 Bo-tree 阅读(439) 评论(0) 推荐(0) 编辑
摘要: 选中程序->右键->显示简介->打开方式 阅读全文
posted @ 2016-01-26 19:01 Bo-tree 阅读(153) 评论(0) 推荐(0) 编辑
摘要: self performSelector: withObject: afterDelay:延迟事件再推出viewcontroller时要注意//取消所有延迟事件 [NSObject cancelPreviousPerformRequestsWithTarget:self]; 阅读全文
posted @ 2016-01-26 19:00 Bo-tree 阅读(178) 评论(0) 推荐(0) 编辑
摘要: CGFloat :在mac上自适应,在64位的系统,会变宽,32位会变窄,手机没变化float:没有变化 阅读全文
posted @ 2016-01-26 18:59 Bo-tree 阅读(401) 评论(0) 推荐(0) 编辑
摘要: cell.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@“图片名”]]; 阅读全文
posted @ 2016-01-26 18:58 Bo-tree 阅读(108) 评论(0) 推荐(0) 编辑
摘要: cmd+option+shift + 左箭头,收起所有代码段cmd+option+shift + 右箭头,打开所有代码段将方法或者注释收起,展开使用时只要鼠标在方法或注释的范围内就好收起:option + command + 移动代码注意:在移动代码时都是移动单行时无需选中,鼠标点击那一行的任何地方... 阅读全文
posted @ 2016-01-26 18:57 Bo-tree 阅读(351) 评论(0) 推荐(0) 编辑
摘要: [self.navigationController.navigationBar setTitleTextAttributes: @{NSFontAttributeName:[UIFont systemFontOfSize:19], NSForegroundColorAttributeName... 阅读全文
posted @ 2016-01-26 18:56 Bo-tree 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 原文:http://www.raywenderlich.com/51127/nsurlsession-tutorial 查理·富尔顿 2013年10月9日, 推特 注意从雷 :这是一个缩写版的一章 iOS 7教程 我们发布的一部分 iOS 7盛宴 。 我们希望你能喜欢! 每一个新的iOS版本包含... 阅读全文
posted @ 2016-01-20 18:32 Bo-tree 阅读(338) 评论(0) 推荐(0) 编辑
摘要: [摘要:正在我们编译的时间偶然候会报那个毛病"library not found for - " 因为是我们正在项目中应用了一些第三圆的库,便比方我再应用百度的静态库文件的时间,报出的那个毛病。 当xcode正在编译的时] 在我们编译的时候有时候会报这个错误"library not found fo... 阅读全文
posted @ 2016-01-20 18:21 Bo-tree 阅读(2513) 评论(0) 推荐(0) 编辑
摘要: /** * 内存管理基本原则(没有看到这几个关键词时,alloc,copy,retain,没有拥有对象的所有权) * 只有通过那几个关键词,才需要手动release */ 阅读全文
posted @ 2016-01-20 15:26 Bo-tree 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 文件下载链接: http://pan.baidu.com/s/1pKbyf4R 密码: ppi7下载完成后将模板放入以下路径应用程序->Xcode->右键显示包内容->/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/... 阅读全文
posted @ 2016-01-20 15:24 Bo-tree 阅读(255) 评论(0) 推荐(0) 编辑
摘要: 1.不添加相应图片的话,审核过不了.例如"As of May 1, all new iPhone apps and app updates submitted must support the 4-inch display on iPhone 5. All apps must include a l... 阅读全文
posted @ 2016-01-20 14:26 Bo-tree 阅读(381) 评论(0) 推荐(0) 编辑
摘要: Step11.点击Image.xcassets 进入图片管理,然后右击,弹出"New Launch Image"2.如图,右侧的勾选可以让你选择是否要对ipad,横屏,竖屏,以及低版本的ios系统做支持.这边我选了ios8.0,ios7.0,ios6没有做支持.Step2将规定尺寸的图片从你的文件中... 阅读全文
posted @ 2016-01-20 14:23 Bo-tree 阅读(331) 评论(0) 推荐(0) 编辑
摘要: 设置显示行号,和行号右边的三角,用于打开和收起代码段 阅读全文
posted @ 2016-01-20 14:20 Bo-tree 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-01-20 14:15 Bo-tree 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 设置方法很简单:打开StoryBoard文件,选中要设置为第一视图的ViewController,在右边工具栏勾选Is Initial View Controller就好了,此时你会看到ViewController上出现了箭头。 阅读全文
posted @ 2016-01-20 13:51 Bo-tree 阅读(406) 评论(0) 推荐(0) 编辑
摘要: 1. 图片视图上不能直接滚动,需要设置交互属性为YES_contentView = [[UIImageView alloc]initWithFrame:CGRectMake(0, _headerView.bottom, kDeviceWidth, kDeviceHeight-20-44-49-_he... 阅读全文
posted @ 2016-01-20 13:47 Bo-tree 阅读(1653) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-01-20 13:43 Bo-tree 阅读(477) 评论(0) 推荐(0) 编辑
摘要: 错误:解决:改掉设备类型为iPhone或者通用 阅读全文
posted @ 2016-01-20 13:41 Bo-tree 阅读(575) 评论(0) 推荐(0) 编辑
摘要: 1. iOS APP Project or Mac APP Project编译错误提示:
“The run destination My Mac 64-bit is not valid for Running the scheme '***'.
The scheme '***' contains n... 阅读全文
posted @ 2016-01-20 13:39 Bo-tree 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 产生这个提示的操作:在xcode4.6中创建一个名字为appTest空工程,create一个ios-application-empty application,直接编译运行错误提示:虽然编译通过,也能运行,但是底下有错误提示“application windows are expected to h... 阅读全文
posted @ 2016-01-20 13:38 Bo-tree 阅读(396) 评论(0) 推荐(0) 编辑
摘要: 使用属性clipsToBounds = YES设置 阅读全文
posted @ 2016-01-20 13:37 Bo-tree 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 正确的结构搭建/*** 1.创建视图控制器 2.创建tabBarItem->UIViewController 3.ViewController作为NavigationController根视图(基栈) 4.NavigationController->array 5.通过setViewControll... 阅读全文
posted @ 2016-01-20 13:34 Bo-tree 阅读(221) 评论(0) 推荐(0) 编辑
摘要: /*** 注意:* 打开自定义tabbar的背景视图的交互* 选中的tabb视图高度为tabbar背景视图的高度/2-选中视图高度/2* 选中视图加载到tabbar背景视图上* label注意居中,imgView注意选择适应模式,都加载到tabbar背景视图* 设置点击手势的点击事件-(void)t... 阅读全文
posted @ 2016-01-20 13:33 Bo-tree 阅读(214) 评论(0) 推荐(0) 编辑
摘要: sql 语句 结构化查询语言 通用数据库操作语言1.创建数据库create database 1407EDB2.删除数据库drop database 1407EDB3.备份use master exec sp_addupdevice ‘disk’,’testBack’,’c:\mssql7backu... 阅读全文
posted @ 2016-01-20 13:24 Bo-tree 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 在App中添加微信分享功能http://www.bubuko.com/infodetail-1140401.html 随着微信平台运用越来越普遍,在app中往往需要将看到的消息发送给微信好友,分享到朋友圈,因此就需要添加微信分享的功能。我们可以通过微信的开发者平台上的相关文档来实现这个简单的功能... 阅读全文
posted @ 2016-01-20 13:17 Bo-tree 阅读(291) 评论(0) 推荐(0) 编辑
摘要: OAuth 相当于授权的U盾,提供第三方认证的协议,是个安全相关的协议,作用在于,使用户授权第三方的应用程序访问用户的web资源,并且不需要向第三方应用程序透露自己的密码。传统互联网:应用于PC端,各个网站和服务之家是封闭的,数据无法交互 把网站的服务封装成一系列计算机易识别的数据接口开放出去,供第... 阅读全文
posted @ 2016-01-20 13:16 Bo-tree 阅读(258) 评论(0) 推荐(0) 编辑