首页 > 其他 > 详细

33.小项目:汽车列表 版本1.0

时间:2015-08-07 01:38:27      阅读:279      评论:0      收藏:0      [点我收藏+]

技术分享

 

------------- ViewController.m -------------

 #import "ViewController.h"


@interface ViewController () <UITableViewDataSource>

@property (weak, nonatomic) IBOutlet UITableView *tableView;


@end


@implementation ViewController


- (void)viewDidLoad

{

    [super viewDidLoad];

    self.tableView.dataSource = self;

}


-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView

{

    return 2;

}


-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

{

    if (section == 0)

    {

        return 2;

    }

    else

    {

        return 3;

    }

}


-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

{

    UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];

    cell.textLabel.text = @"宝马";

    return cell;

}


@end 

33.小项目:汽车列表 版本1.0

原文:http://www.cnblogs.com/lixiang2015/p/4709538.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!