上一页 1 2 3 4 5 6 7 8 9 10 ··· 18 下一页

C语言指针

摘要: 用变量a给出下面的定义a)一个整型数b)一个指向整型数的指针(Apointertoaninteger)c)一个指向指针的的指针,它指向的指针是指向一个整型数(Apointertoapointertoanintege)rd)一个有10个整型数的数组(Anarrayof10integers)e)一个有1 阅读全文
posted @ 2016-04-14 17:09 哈利波特大 阅读(213) 评论(0) 推荐(0)

iOS block

摘要: 对于大多数人来讲,block内部到底是怎样实现的呢?我们可以借助clang将其编译成为c++的代码,就可以看出,block到底是什么东西, 先来看这样一个问题, 以及下面的这一段代码 你会发现这两个结果是不同的, 第一个输出10,第二个输出的是30 要想知道这里面干了些什么!需要我们将其编译成为C+ 阅读全文
posted @ 2016-04-14 16:19 哈利波特大 阅读(185) 评论(0) 推荐(0)

iOS 通知 代理 block

摘要: 通知:“一对多”,在APP中,很多控制器都需要知道一个事件,应该用通知;delegate:1,“一对一”,对同一个协议,一个对象只能设置一个代理delegate,所以单例对象就不能用代理;2,代理更注重过程信息的传输:比如发起一个网络请求,可能想要知道此时请求是否已经开始、是否收到了数据、数据是否已 阅读全文
posted @ 2016-04-14 16:10 哈利波特大 阅读(222) 评论(0) 推荐(0)

循环引用的案例

摘要: 一、parent-child相互持有、委托模式 【案例】: ? 1 2 3 4 5 6 @interface FTAppCenterMainViewController () { } @property(weak,nonatomic) UITableView* myTableView; @end ? 阅读全文
posted @ 2016-04-14 15:43 哈利波特大 阅读(148) 评论(0) 推荐(0)

UISearchController

摘要: #import "ViewController.h" @interface ViewController () <UITableViewDelegate, UITableViewDataSource, UISearchResultsUpdating, UISearchControllerDelega 阅读全文
posted @ 2016-04-14 09:35 哈利波特大 阅读(382) 评论(0) 推荐(0)

循环创建按钮

摘要: CGFloat margin = 22; CGFloat btnW = 35; CGFloat btnH = 35; int cloums = 7; CGFloat btnLeft = (self.view.frame.size.width - (btnW * cloums) - (cloums - 阅读全文
posted @ 2016-04-13 17:56 哈利波特大 阅读(253) 评论(0) 推荐(0)

UITextField Delegate

摘要: - (BOOL)textFieldShouldBeginEditing:(UITextField *)textField; // return NO to disallow editing. 返回NO 文本框不可编辑 - (void)textFieldDidBeginEditing:(UITextF 阅读全文
posted @ 2016-04-11 19:26 哈利波特大 阅读(218) 评论(0) 推荐(0)

键盘的弹出和收回

摘要: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyBoardFrameChange:) name:UIKeyboardWillChangeFrameNotification object:nil] 阅读全文
posted @ 2016-04-11 19:22 哈利波特大 阅读(201) 评论(0) 推荐(0)

循环创建按钮

摘要: #import "UserCell.h" #define kBorderX 5 // 左边 #define kBorderY 0 // 上边 #define kMargin 5 #define kImageViewW ([UIScreen mainScreen].bounds.size.width 阅读全文
posted @ 2016-04-04 16:04 哈利波特大 阅读(139) 评论(0) 推荐(0)

通过Xib创建 UICollectionView 和自定义UICollectionViewCell

摘要: 1。在控制器的viewDidLoad方法中添加代码 CGFloat itemWidth = (kScreenW - kSpacingW * 3) / 2; NSLog(@"itemWidth == %f",itemWidth); CGFloat itemHeight = itemWidth * 0. 阅读全文
posted @ 2016-04-03 17:50 哈利波特大 阅读(1591) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 10 ··· 18 下一页