我有一个表视图加载一个 sqldata 文件,该文件在单元格中显示标签和图像。我希望将图像和其他数据加载到下一个 vc 中,但似乎甚至无法获取日志来拉回文件时间,因此没有机会将其推过。这一切都是以编程方式完成的,所以发现它有点困难。所有帮助表示赞赏!!!!
//表格视图
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath >*)indexPath { [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; ATPictureViewController *newView = [[ATPictureViewController alloc] init]; newView.mainImageView.image=[tableView >cellForRowAtIndexPath:indexPath].imageView.image ; [self.navigationController pushViewController:newView animated:YES]; // NSLog(@"Log33 %@",); } @end
我以为就是这样
newView.mainImageView.image=[tableView cellForRowAtIndexPath:indexPath].imageView.image;
但什么也没给我
//vc.h #import <UIKit/UIKit.h> @interface ATPictureViewController : UIViewController{ UIImageView *mainImage; } @property (strong, nonatomic) UIImageView *mainImageView; @end
不知道我是否在这里打电话
//vc.m - (void)viewDidLoad { [super viewDidLoad]; self.mainImageView = [[UIImageView alloc] initWithFrame:CGRectMake(50, 50, 200, 200)]; [self.view addSubview:self.mainImageView]; self.mainImageView.image = ???????????