I try to display objects of an array in a tableview. This is a single screen app, I'm using storyboard. When running - the tableview appears as an empty grid. the data of the objects is not displayed. what may cause this? Having 2 required methods numberOfRowsInSection and cellForRowAtIndexPath I suspect the last one. The .h file contains this row:
@interface MYViewController : UIViewController <UITableViewDataSource, UITableViewDelegate>
I set the delegate & datasource via the code as you suggested. still empty grid.
This is my implementation: -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [listRecipes.recipeArray count]; }
-(UITableViewCell )tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString cellIdentifier = @"ListCellIdentifier"; MYCustomListCell* listCell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; NSString* dataString = listRecipes.recipeArray[indexPath.row]; listCell.listName.text = dataString; listCell.imageView.image = [UIImage imageNamed:dataString]; return listCell; }
I try to display data from an array in MVC . If the array is local - the data is displayed
Can you please advise what to do? Thank you in advanced.