不调用UITableView委托

the*_*men 5 objective-c ios5

我有一个带外部委托控制器的tableview.尽管内容表视图数组已经很好地填充,
numberOfSectionsInTableView:并且 -tableView: numberOfRowsInSection:被调用,
但是-tableView: cellForRowAtIndexPath:没有被调用.

发布的表视图以这种方式设置:

CompeticionViewController.h

....

@property (retain, nonatomic) IBOutlet UITableView *calendarioTable;
@property (strong, nonatomic)  calendarioViewController *calendarioController;

....

calendarioTable = [[UITableView alloc] init];

            calendarioController  = [[calendarioViewController alloc] init];

            [calendarioTable setDelegate:calendarioController];

            [calendarioTable setDataSource:calendarioController];

            calendarioController.calendarioArray = [[NSMutableArray alloc] init];

            [calendarioController.calendarioArray addObjectsFromArray: self.calendarioarray];

            [calendarioTable reloadData];
Run Code Online (Sandbox Code Playgroud)

编辑:

calendarioViewController.m

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{

    return 1;
}

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

    return [calendarioArray count];

}
Run Code Online (Sandbox Code Playgroud)

非常感谢

Par*_*iya 1

你已经用了IBOuletfortableview那么你为什么要把allocating它当作它的not need memory already allocated

现在签入xib您的视图控制器tableview并将bindeddelegate提供datasourcefile owner

- - - - - - - - - - - - - - - - - - - - -或者- - - - ----------------------------------------------------

add这条线在viewDidLoad method

yourtableview.delegate=self

yourtableview.datasource=self; 
Run Code Online (Sandbox Code Playgroud)

现在使用IBOuletfor之后tableview,您将把它与文件所有者和 ViewController绑定interface implements在一起<UITableViewDelegate><UITableViewDataSource> protocols

现在check array你已经providingtableview其中content

编辑:添加 OR 代码并完成格式化