UITableView delegates are not called

I have a table view with an external delegate controller. Despite the fact that the array of tables of the table of contents is well filled, numberOfSectionsInTableView:it -tableView: numberOfRowsInSection:is called, -tableView: cellForRowAtIndexPath:not called.

The presented table view is defined in the following ways:

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];

Edition:

calendarioViewController.m

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

    return 1;
}

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

    return [calendarioArray count];

}

Many thanks

+5
source share
3 answers

In .xib delegate the link to the file and data source with the owner of the file or write

tableview.delegate=self

tableview.datasource=self; 
+4
source

You used IBOuletto tableview, why u allocatingis like him not need memory already allocated.

xib , tableview binded delegate datasource file owner.

----------------------------------------- ------------------------------------------------

add viewDidLoad method

yourtableview.delegate=self

yourtableview.datasource=self; 

IBOulet tableview ViewController interface implements <UITableViewDelegate>, <UITableViewDataSource> protocols

check array providing tableview content

: OR

+1

, CompeticionViewController <UITableViewDelegate> <UITableViewDataSource>.

0

All Articles