Hi,
Here is the code I'm using for the .h file:
Code:
@interface MoreTermsViewController : UITableViewController {
NSMutableArray* drinks;
}
@property (nonatomic, retain) NSMutableArray* drinks;
@end
and the .m file:
Code:
@synthesize drinks;
- (void)viewDidLoad {
[super viewDidLoad];
NSString *path = [[NSBundle mainBundle] pathForResource:@"DrinksDirections" ofType:@"plist"];
NSMutableArray* tmpArray = [[NSMutableArray alloc] initWithContentsOfFile:path];
self.drinks = tmpArray;
[tmpArray release];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [self.drinks count];
}
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell.
cell.textLabel.text = [[self.drinks objectAtIndex:indexPath.row] objectForKey:NAME_KEY];
/* cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; */
return cell;
}
My question is.. what is the code I need to add to load another string from the plist into the subview of the cells? I've looked through tutorials and I can't figure it out. It is a single level table so there is no drill down involved.
Thanks for your help! I'm new to this