【发布时间】:2013-08-06 08:38:36
【问题描述】:
我正在使用故事板。我想在表格视图中选择一个元素时添加一个子视图。
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [arr count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
NSString *cellvalue = [arr objectAtIndex:indexPath.row];
cell.textLabel.text=cellvalue;
cell.imageView.image=[UIImage imageNamed:@"1.png"];
return cell;
}
【问题讨论】:
-
我是ios开发新手。
标签: iphone ios objective-c storyboard