Block块.1.声明Blockint (^myBlock)(int n) = ^(int num)类型 (^名称)(需要传的参数)= ^(参数)2 __block 变量在block块中修改block块外部变量的值,只有将外部的变量前面加_ _(两个短杠才能修改)3 __weak 变量在ARC机制下...
分类:
移动开发 时间:
2015-10-05 23:14:40
阅读次数:
284
#import "MJViewController.h"#import "MJCarGroup.h"@interface MJViewController () @property (weak, nonatomic) IBOutlet UITableView *tableView;@property...
分类:
移动开发 时间:
2015-10-04 22:12:22
阅读次数:
382
#import "MJViewController.h"@interface MJViewController () @property (weak, nonatomic) IBOutlet UIScrollView *scrollView;@property (weak, nonatomic) I...
分类:
移动开发 时间:
2015-10-01 11:41:31
阅读次数:
224
#import "ViewController.h"@interface ViewController ()@property (weak, nonatomic) IBOutlet UIScrollView *scrollView;@property (weak, nonatomic) IBOutl...
分类:
移动开发 时间:
2015-09-30 19:36:49
阅读次数:
326
1、一个错误The current deployment target does not support automated __weak references这个错误被所述支持iOS版本号不支持相对低的weakkeyword,要替换 unsafe_unretained 问题得以克服。 ...
分类:
移动开发 时间:
2015-09-30 16:05:34
阅读次数:
232
利用国庆假期,复习了一下之前学的知识,发现之前的知识自己都忘的差不多了,赶紧的抓紧时间好好的练习练习,为下个月找工作做好准备啊......#import "ViewController.h"@interface ViewController ()@property (weak, nonatomic)...
分类:
Web程序 时间:
2015-09-30 10:53:22
阅读次数:
264
使用NSTimer的类#import "TBTimerTestObject.h"#import "TBWeakTimerTarget.h"@interface TBTimerTestObject()@property (nonatomic, weak) NSTimer *timer;@end@imp...
分类:
移动开发 时间:
2015-09-29 18:23:21
阅读次数:
308
有时候我们需呀输入的内容是联动的,比如省份与城市,书名与章节等,这时候我们可以使用UIPickerVIew来实现.首先向设计界面中拖入一个pickerView并关联代码,同时设置dataSource和delegate代理.注:不要忘了在.h文件中添加协议@property (weak, nonato...
分类:
其他好文 时间:
2015-09-29 16:55:14
阅读次数:
160
因为控件他爹( view.superview )已经揪着它的小辫了( strong reference ),你( viewController )眼瞅着( weak reference )就好了。当然,如果你想在 view 从 superview 里面 remove 掉之后还继续持有的话,还是要用 ...
分类:
其他好文 时间:
2015-09-28 20:44:56
阅读次数:
135
自定义Cell如图一个View上面放了四个Label分别连线到.m文件中@property (weak, nonatomic) IBOutlet UILabel *nameLabel;@property (weak, nonatomic) IBOutlet UILabel *positionLabe...
分类:
其他好文 时间:
2015-09-27 22:54:06
阅读次数:
454