Right now I have a tableview, and I can assure you that the delegate method all work. But I am trying to load the tableview from an array. the same array returns actual objects when i log then earlier in the app, but when I try to access the same array in - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
it always returns nil/null.Here is the implementation of - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath:
NSLog(@"cell for row at twitter called");
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
NSDictionary *tweet = [timeLineData objectAtIndex:indexPath.row];
// NSLog(@"Tweet at index %d is %@", [indexPath row], tweet);
//NSLog(@"Tweet: %@", tweet);
cell.textLabel.text = [tweet objectForKey:@"text"];
cell.detailTextLabel.text = [tweet valueForKeyPath:@"user.name"];
return cell;
I am so confused as to why this is, because in all of my other projects the same code works just fine. Any help would be greatly appreciated.
Thanks, Virindh Borra
NSLogstatement called? What is the code inside yournumberOfRowsInSectionmethod?