iOS开发
RubyCrow
这个作者很懒,什么都没留下…
展开
-
iOS 8 xcode 6 beta 模拟器键盘不弹出
You just need to toggle the software keyboard by selecting: iOS Simulator -> Hardware -> Keyboard -> Toggle Software Keyboard. Then, everything works原创 2014-08-29 11:50:01 · 2664 阅读 · 0 评论 -
NSLayoutConstraints Coding
[NSLayoutConstraint constraintsWithVisualFormat:options:metrics:views: ]; 复制代码 constraintsWithVisualFormat:参数为NSString型,指定Contsraint的属性,是垂直方向的限定还是水平方向的限定,参数定义一般如下: V:|-(>=XXX) :表示垂转载 2014-04-17 10:51:50 · 723 阅读 · 0 评论 -
NSPredicate
简述:Cocoa框架中的NSPredicate用于查询,原理和用法都类似于SQL中的where,作用相当于数据库的过滤取。 定义(最常用到的方法): [cpp] view plaincopy NSPredicate *ca = [NSPredicate predicateWithFormat:(NSString *), ...];转载 2014-04-09 14:39:18 · 791 阅读 · 0 评论 -
使用weak指针的代理模式
这样的一个例子是代理模式。 你的控制器拥有一个指向 UITableView 的 strong 指针。 Table View 的 datasource 和 delegate 反过来指向控制器,但用的是 weak 指针。原创 2014-04-12 19:18:42 · 879 阅读 · 0 评论 -
声明式编程和命令式编程的比较
先统一一下概念,我们有两种编程方式:命令式和声明式。 我们可以像下面这样定义它们之间的不同: 命令式编程:命令“机器”如何去做事情(how),这样不管你想要的是什么(what),它都会按照你的命令实现。声明式编程:告诉“机器”你想要的是什么(what),让机器想出如何去做(how)。 声明式编程和命令式编程的代码例子 举个简单的例子,假设我们想让一个数组里的数值翻倍。转载 2014-06-04 14:03:29 · 1168 阅读 · 0 评论 -
IOS TableViewCell 透明背景
本文来自http://blog.csdn.net/RubyCrow 转载请说明出处 - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { cell.backgroundColor =原创 2014-03-28 13:47:18 · 2362 阅读 · 0 评论 -
在线生成.gitignore的工具
http://www.gitignore.io/原创 2014-03-31 14:24:38 · 1963 阅读 · 0 评论 -
iOS7中类似iOS6效果的Grouped TableView
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { if ([cell respondsToSelector:@selector(tintColor)]) { if (ta原创 2014-05-28 16:39:17 · 905 阅读 · 0 评论 -
IOS 添加字体
1、向工程内添加*.tff字体文件。 2、检查*.tff字体文件是否包含在Target -> Bundle Phases -> Copy Bound Resources 下的列表中没有就添加进来。 3、编辑工程的Info.plist在其中添加Fonts provided by application(Raw Keys:UIAppFonts)并在Item中添加*.tff。 4、获取转载 2014-03-26 17:06:55 · 771 阅读 · 0 评论 -
iOS 改变UITextField中光标颜色
方法1: [[UITextField appearance] setTintColor:[UIColor blackColor]]; 这种方法将影响所有TextField。 方法2: textField.tintColor = [UIColor redColor]; 如果在InterfaceBuilder中修改View的TintColor属性并不好用。原创 2014-03-28 16:50:23 · 50725 阅读 · 0 评论 -
UITableView 去除多余的分割线
For iOS 7.* and iOS 6.1 The easiest method is to set the tableFooterView property: - (void)viewDidLoad { [super viewDidLoad]; // This will remove extra separators from tableview self原创 2014-08-15 18:01:20 · 1433 阅读 · 0 评论 -
OC 关联的使用
转载请标明出处:http://blog.csdn.net/zhangxingping 关联 关联是指把两个对象相互关联起来,使得其中的一个对象作为另外一个对象的一部分。 关联特性只有在Mac OS X V10.6以及以后的版本上才是可用的。 在类的定义之外为类增加额外的存储空间 使用关联,我们可以不用修改类的定义而为其对象增加存储空间。这在我们无法访问转载 2014-03-23 15:59:49 · 932 阅读 · 0 评论