zoukankan      html  css  js  c++  java
  • 属性初始化

    -(NSMutableArray *)banners
    {
        if (_banners ==nil) {
            self.banners = [NSMutableArray array];
        }
        return _banners;
    }
     if (_shops==nil) {
            self.shops = [NSMutableArray array];
        }
    
     if (_optionalParam ==nil) {
            self.optionalParam = [[NSMutableDictionary alloc]init];
        }
    - (UITableView *)tableView
    {
        if (nil == _tableView) {
            _tableView = [[UITableView alloc] init];
            [self.view addSubview: _tableView];
            [_tableView makeConstraints:^(MASConstraintMaker *make) {
                make.edges.equalTo(UIEdgeInsetsMake(0, 0, 0, 0));
            }];
            _tableView.delegate = self;
            _tableView.dataSource = self;
            NSString * cellReuseIdentifier = NSStringFromClass([UITableViewCell class]);
            [_tableView registerClass: NSClassFromString(cellReuseIdentifier) forCellReuseIdentifier:cellReuseIdentifier];
            _tableView.header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
                self.page = 0;
                [self updateData];
            }];
            _tableView.footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
                [self updateData];
            }];
    
        }

       

    
    
  • 相关阅读:
    最优二叉查找树
    最长公共子序列问题
    最大子段和问题
    01背包问题
    浅析LRU(K-V)缓存
    LeetCode——LRU Cache
    LeetCode——Gas Station
    LeetCode——Jump Game II
    LeetCode——Jump Game
    LeetCode——Implement Trie (Prefix Tree)
  • 原文地址:https://www.cnblogs.com/fengmin/p/5501260.html
Copyright © 2011-2022 走看看