i have a global variable "prodTableArray" which is a barcode string that converts itself into an array so it can show the product number in the tableview. as sort of a shopping cart list.
but it pulls the barcode from the first view controller and it doesn't automatically show up in my tableview unless i rotate it, i also have a similar problem with with a UIImageView on another view controller except that i added a button to retrieve the image.
but i want to get rid of the button and do it automatically, is this possible?
heres my table code, how can it automatically update after each barcode scan, i know view willappear works but than the user is going to have to click on another view controller and click back to load the image.
but it pulls the barcode from the first view controller and it doesn't automatically show up in my tableview unless i rotate it, i also have a similar problem with with a UIImageView on another view controller except that i added a button to retrieve the image.
but i want to get rid of the button and do it automatically, is this possible?
heres my table code, how can it automatically update after each barcode scan, i know view willappear works but than the user is going to have to click on another view controller and click back to load the image.
Code:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
ImageStrings* theDataObject = [self theImageClass];
// Return the number of rows in the section.
return [theDataObject.prodTableArray count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
ImageStrings* theDataObject = [self theImageClass];
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
cell.textLabel.text = [theDataObject.prodTableArray objectAtIndex:[indexPath row]];
return cell;
}
Last edited: