0

Using Xcode 5 for iPhone.
I try to display data in a tableview from an array in MVC (not local array) - but the data is not displayed in the table and appears empty grid.
I'm using storyboard (not nib), and custom cell (not TableViewController).
Can you please Advise what am I missing? Thanks in advance
The code looks like this:

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

NSLog (@"array count is %i", listRecipes.recipeArray.count);        
return [listRecipes.recipeArray count];
} 

and also

-(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;
} 
tereško
  • 58,060
  • 25
  • 98
  • 150
ici
  • 1
  • 3

1 Answers1

0

You should add some code to this question.

My guess is that you haven't provided an implementation for UITableViewDataSource's tableView:numberOfRowsInSection:

That should likely return the count of objects in your array.

bpapa
  • 21,409
  • 25
  • 99
  • 147