Browse Source

replace some keyword

replace some keyword
MJLee 10 years ago
parent
commit
5f8c71b3d8

+ 1 - 1
MJRefresh.podspec

@@ -1,6 +1,6 @@
 Pod::Spec.new do |s|
     s.name         = 'MJRefresh'
-    s.version      = '3.0.0'
+    s.version      = '3.0.1'
     s.summary      = 'An easy way to use pull-to-refresh'
     s.homepage     = 'https://github.com/CoderMJLee/MJRefresh'
     s.license      = 'MIT'

+ 1 - 1
MJRefresh/Custom/Footer/Auto/MJRefreshAutoStateFooter.m

@@ -11,7 +11,7 @@
 @interface MJRefreshAutoStateFooter()
 {
     /** 显示刷新状态的label */
-    __weak UILabel *_stateLabel;
+    __unsafe_unretained UILabel *_stateLabel;
 }
 /** 所有状态对应的文字 */
 @property (strong, nonatomic) NSMutableDictionary *stateTitles;

+ 1 - 1
MJRefresh/Custom/Footer/Back/MJRefreshBackNormalFooter.m

@@ -10,7 +10,7 @@
 
 @interface MJRefreshBackNormalFooter()
 {
-    __weak UIImageView *_arrowView;
+    __unsafe_unretained UIImageView *_arrowView;
 }
 @property (weak, nonatomic) UIActivityIndicatorView *loadingView;
 @end

+ 1 - 1
MJRefresh/Custom/Footer/Back/MJRefreshBackStateFooter.m

@@ -11,7 +11,7 @@
 @interface MJRefreshBackStateFooter()
 {
     /** 显示刷新状态的label */
-    __weak UILabel *_stateLabel;
+    __unsafe_unretained UILabel *_stateLabel;
 }
 /** 所有状态对应的文字 */
 @property (strong, nonatomic) NSMutableDictionary *stateTitles;

+ 1 - 1
MJRefresh/Custom/Header/MJRefreshNormalHeader.m

@@ -10,7 +10,7 @@
 
 @interface MJRefreshNormalHeader()
 {
-    __weak UIImageView *_arrowView;
+    __unsafe_unretained UIImageView *_arrowView;
 }
 @property (weak, nonatomic) UIActivityIndicatorView *loadingView;
 @end

+ 2 - 2
MJRefresh/Custom/Header/MJRefreshStateHeader.m

@@ -11,9 +11,9 @@
 @interface MJRefreshStateHeader()
 {
     /** 显示上一次刷新时间的label */
-    __weak UILabel *_lastUpdatedTimeLabel;
+    __unsafe_unretained UILabel *_lastUpdatedTimeLabel;
     /** 显示刷新状态的label */
-    __weak UILabel *_stateLabel;
+    __unsafe_unretained UILabel *_stateLabel;
 }
 /** 所有状态对应的文字 */
 @property (strong, nonatomic) NSMutableDictionary *stateTitles;

+ 1 - 1
MJRefreshExample/Classes/First/MJExampleViewController.m

@@ -62,7 +62,7 @@ - (void)viewDidLoad
 {
     [super viewDidLoad];
     
-    __weak UITableView *tableView = self.tableView;
+    __unsafe_unretained UITableView *tableView = self.tableView;
     
     // 下拉刷新
     tableView.mj_header= [MJRefreshNormalHeader headerWithRefreshingBlock:^{

+ 2 - 2
MJRefreshExample/Classes/First/MJSingleViewController.m

@@ -21,8 +21,8 @@ - (void)viewDidLoad {
     
     self.count = 0;
     
-    __weak typeof(self) weakSelf = self;
-    __weak UITableView *tableView = self.tableView;
+    __unsafe_unretained typeof(self) weakSelf = self;
+    __unsafe_unretained UITableView *tableView = self.tableView;
     
     tableView.mj_header= [MJRefreshNormalHeader headerWithRefreshingBlock:^{
         dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{

+ 1 - 1
MJRefreshExample/Classes/Second/MJCollectionViewController.m

@@ -28,7 +28,7 @@ @implementation MJCollectionViewController
 #pragma mark UICollectionView 上下拉刷新
 - (void)example21
 {
-    __weak __typeof(self) weakSelf = self;
+    __unsafe_unretained __typeof(self) weakSelf = self;
     
     // 下拉刷新
     self.collectionView.mj_header= [MJRefreshNormalHeader headerWithRefreshingBlock:^{

+ 2 - 6
MJRefreshExample/Classes/Second/MJTableViewController.m

@@ -37,7 +37,7 @@ @implementation MJTableViewController
 #pragma mark UITableView + 下拉刷新 默认
 - (void)example01
 {
-    __weak __typeof(self) weakSelf = self;
+    __unsafe_unretained __typeof(self) weakSelf = self;
     
     // 设置回调(一旦进入刷新状态就会调用这个refreshingBlock)
     self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
@@ -46,10 +46,6 @@ - (void)example01
     
     // 马上进入刷新状态
     [self.tableView.mj_header beginRefreshing];
-    
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-        [self.tableView.mj_header beginRefreshing];
-    });
 }
 
 #pragma mark UITableView + 下拉刷新 动画图片
@@ -139,7 +135,7 @@ - (void)example11
 {
     [self example01];
     
-    __weak __typeof(self) weakSelf = self;
+    __unsafe_unretained __typeof(self) weakSelf = self;
     
     // 设置回调(一旦进入刷新状态就会调用这个refreshingBlock)
     self.tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{

+ 2 - 2
MJRefreshExample/Classes/Second/MJWebViewViewController.m

@@ -18,10 +18,10 @@ @implementation MJWebViewViewController
 #pragma mark - 示例
 - (void)example31
 {
-    __weak UIWebView *webView = self.webView;
+    __unsafe_unretained UIWebView *webView = self.webView;
     webView.delegate = self;
     
-    __weak UIScrollView *scrollView = self.webView.scrollView;
+    __unsafe_unretained UIScrollView *scrollView = self.webView.scrollView;
     
     // 添加下拉刷新控件
     scrollView.mj_header= [MJRefreshNormalHeader headerWithRefreshingBlock:^{