0
나는 자신을 재귀 적으로 n 번 호출하는 UITableViewController
있습니다재귀있는 UITableViewController 및 대표
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 0) {
// call different controller
}
else if (indexPath.section == 1) {
GroupTableViewController *tableView = [[GroupTableViewController alloc] initWithStyle:UITableViewStyleGrouped];
tableView.delegate = self;
[self.navigationController pushViewController:tableView animated:TRUE];
}
}
내가 현재 GroupTableViewController
에 새로운 GroupTableViewController
의 대리자를 설정해야합니다.
Assigning to `id<GroupTableViewDelegate>' from incompatiable type `GroupTableViewController *const_strong`
그래서 내 첫번째 생각은 GroupTableViewDelegate
프로토콜을 포함했다 : 나는 코드에서와 같이 대리자를 설정하려고하면
, 내가 경고를
@interface GroupTableViewController : UITableViewController <RegionTableViewDelegate, GroupTableViewDelegate>
을 그러나 이것은 원인 경고 :
Cannot find protocal definition for `GroupTableViewDelegate`
하지만
하려고하면#import "GroupTableViewController.h"
문제가 발생할 수 있습니다.
어떻게하면됩니까? 여기
GroupTableViewController *tableView =
[[GroupTableViewController alloc] initWithStyle:UITableViewStyleGrouped];
tableView
UITableView
인스턴스에 대한 포인터 여기
- (void)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath
tableView
됩니다
이름을 변경해야 GroupTableViewController 인스턴스에 대한 포인터 -
좋아, 나는 th 전자 컨트롤러, 불행히도 그것은 경고를 해결하지 못했습니다. 아직 가지고있어. – Padin215
@ Log139,'controller.delegate = self'도'controller.tableView.delegate = self'로 변경 했습니까? – foundry
아, 아니에요. 전체 게시물을 읽지 못해 죄송합니다. 나는 그것을 훑어 보았고 내가 무엇을해야할지 알았다고 생각했다. 분명히 나는하지 않았다. 고맙습니다, 그 경고를 분명히했습니다. – Padin215