我可以用相机拍照并保存在文件夹中。图像将加载到UITableView
. 如果我选择特定行,对应图像将转到下一个视图并显示图像。这是我的代码:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"Enter into cellforRow");
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
NSString *FileName = [NSString stringWithFormat:@"test1.png"];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *tempPath = [documentsDirectory stringByAppendingPathComponent:FileName];
//image
imageView = [[UIImageView alloc]initWithFrame:CGRectMake(10.0, 10.0, 60.0, 60.0)];
[imageView setImage:[arrayOfImages objectAtIndex:indexPath.row]];
[cell.contentView addSubview:imageView];
return cell;
}
现在在didSelectRowAtIndexPath
方法中添加什么