小编iOS*_*bie的帖子

UITableViewCell链接到PageViewController中的特定页面

我对iOS编程很新,遇到了一个我自己无法解决的问题.

我的应用程序的主要部分是可搜索的动物列表(AnimalTableViewController)(此功能有效).单击某个单元格后,您应该能够查看动物的图像.所有动物图像都在PagerViewController(CustomPagerViewController)中编译.

我的故事板的图像可以在这里找到http://i50.tinypic.com/ve14r4.jpg

我需要做的是将动态表格单元格连接到特定的视图/故事板.我以前能够将单元格连接到图像 - 图像数组显示在单个视图控制器中.我这次选择通过PagerViewController进行操作,因为我需要滑动功能(与滑动相关的方法可以在PagerViewController.m中找到,它们都按预期工作).

请你帮我解决这个问题,我没有找到关于如何在UITableView和PagerViewController之间传递数据的任何教程或建议.

AnimalTableViewController.m

@implementation AnimalTableViewController

@synthesize allTableData;
@synthesize filteredTableData;
@synthesize searchBar;
@synthesize isFiltered;
@synthesize tableView;

- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super init];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];

    tableView.delegate = (id)self;
    tableView.dataSource = (id)self;

    searchBar.delegate = (id)self;

    allTableData = [[NSMutableArray alloc] initWithObjects:
                    [[Animal alloc] …
Run Code Online (Sandbox Code Playgroud)

objective-c uitableview ios

5
推荐指数
1
解决办法
545
查看次数

标签 统计

ios ×1

objective-c ×1

uitableview ×1