如何识别从两个可用的UITableView中选择

Spo*_*ude 0 objective-c ios xcode4.5

我有一个UITabView iPad应用程序,使用的XCode 4.5,故事板和iOS 6.我有一个UIView场景,具有两个UITableViews(一个在左上象限,另一个在UIView的下半部).我的问题是我需要确定为numberOfRowsInSectioncellForRowAtIndexPath引用了哪个UITableView .我已经给出了两个UITableViews名称:

图像显示id

我不认为这是正确的,因为当我在numberOfRowsInSection上断点时,它任意选择较低的UITableView(previousAppointments),从不选择上层UITableView(clientList).代码如下:

//------------------------------------------------
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    if (tableView == clientList)  {
        int y = listOfClients.count;
        return 1;  //  return list of clients          <---------  TODO
    }
    else if(tableView == previousAppointments) {
        return 2;  //  return number of appointments for this client    <------------ TODO
    }

    return 1;
}
Run Code Online (Sandbox Code Playgroud)

我需要能够识别选择哪个UITableView,以便我可以用正确的数据填充它.

我究竟做错了什么?

rde*_*mar 5

您应该为每个表视图设置IBOutlets,并在if语句中使用该出口名称