-(void)refreshTable:(NSArray)myArray:(NSArray*)mySecondArray:(NSArray*)myThirdArray:(NSArray)myForthArray {
//The "another" arrays are declared in the header file
anotherArray=myArray;
anotherSecondArray=mySecondArray;
anotherThirdArray = myThirdArray;
anotherForthArray = myForthArray;
NSLog(@"Refresh Table Function");
NSLog([NSString stringWithFormat:@"anotherArray count = %i",[anotherArray count]]);
[tblView reloadData];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [anotherArray count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}
// Set up the cell...
cell.text = [[NSString alloc] initWithFormat:@"Row %i)",indexPath.row];
return cell;
}
I know the function is getting called because the log displays the two messages and I know the anotherArray has objects because it says so in the log. It's just the reloadData that isn't working because the UITableView has no rows even after the reload call.
I know the table works because if I change the numberOfRowsInSection to return 10 then I get 10 rows of "Row 0", "Row 1" etc.
Thanks,
Tom
Message was edited by: harrytheshark