【发布时间】:2011-06-29 11:11:11
【问题描述】:
我在一个类中为 tableview 提供了这些委托方法:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [array1 count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(cell == nil){
cell = [[[UITableViewCell alloc]initWithStyle:UITableViewStylePlain reuseIdentifier:CellIdentifier] autorelease] ;
}
cell.textLabel.text = [array1 objectAtIndex:indexPath.row];
return cell;
}
如果我有一个 UITableView 没关系,但如果我有两个 UITableView?如何组织我的代码?带标签?
【问题讨论】:
标签: ios xcode uitableview delegates