IOS tableview 使用

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/ltf857/article/details/89281440

1 tablecell
cell 添加identity
2 tableview
设置和cell高度一样
3

[self.tableView registerNib:[UINib nibWithNibName:@"ParkCell" bundle:nil] forCellReuseIdentifier:@"cellID"];
self.tableView.delegate = self;
			self.tableView.dataSource = self;
			[self.tableView reloadData];
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
	return 10;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
	NSInteger index = indexPath.row;
	ParkCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellID" forIndexPath:indexPath];
	return cell;
}

猜你喜欢

转载自blog.csdn.net/ltf857/article/details/89281440