设为首页 加入收藏

TOP

1014-34-首页15-计算原创微博的frame------计算cell的高度---计算 UILabel 的 CGSize 的方法(二)
2017-10-12 18:17:06 】 浏览:7837
Tags:1014-34- 首页 15- 计算 原创 frame------ cell 高度 --- UILabel CGSize 方法
stausFramesWithStatuses:newStatuses];
        
        // 将最新的微博数据,添加到总数组的最前面
        NSRange range = NSMakeRange(0, newFrames.count);
        NSIndexSet *set = [NSIndexSet indexSetWithIndexesInRange:range];
        [self.statusFrames insertObjects:newFrames atIndexes:set];  // statusFrames 这个是 数组,存放每一条微博的 frame模型
        
        // 刷新表格
        [self.tableView reloadData];
        
        // 结束刷新
        [control endRefreshing];
        
        // 显示最新微博的数量
        [self showNewStatusCount:newStatuses.count];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        HWLog(@"请求失败-%@", error);
        
        // 结束刷新刷新
        [control endRefreshing];
    }];
}
  

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    // 获得cell
    HWStatusCell *cell = [HWStatusCell cellWithTableView:tableView];
    
    // 给cell传递模型数据, 在 setStatusFrame 里面完成 对各个子控件的 frame 赋值和 数据赋值。
    cell.statusFrame = self.statusFrames[indexPath.row];
    
    return cell;
}  



---------------------------HWStatus.h---------------------------------------------
//  HWStatus.h
//
//  Created by apple on 14-10-12.
//  Copyright (c) 2014年 heima. All rights reserved.
//  微博模型

#import <Foundation/Foundation.h>
@class HWUser;

@interface HWStatus : NSObject
/**    string    字符串型的微博ID*/
@property (nonatomic, copy) NSString *idstr;

/**    string    微博信息内容*/
@property (nonatomic, copy) NSString *text;

/**    object    微博作者的用户信息字段 详细*/
@property (nonatomic, strong) HWUser *user;

/**    string    微博创建时间*/
@property (nonatomic, copy) NSString *created_at;

/**    string    微博来源*/
@property (nonatomic, copy) NSString *source;
@end

 

---------------------------HWStatus.m---------------------------------------------
//  HWStatus.m
//
//  Created by apple on 14-10-12.
//  Copyright (c) 2014年 heima. All rights reserved.
//

#import "HWStatus.h"

@implementation HWStatus
@end

---------------------------HWStatusFrame.h---------------------------------------------

//
//  HWStatusFrame.h
//
//  Created by apple on 14-10-14.
//  Copyright (c) 2014年 heima. All rights reserved.
//  一个HWStatusFrame模型里面包含的信息
//  1.存放着一个cell内部所有子控件的frame数据
// 

首页 上一页 1 2 3 4 5 6 7 下一页 尾页 2/7/7
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Objective-c 集合对象 下一篇Objective-c 深浅复制

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目