Im assuming your ticket is a UITableViewCell since you are mentioning "tableviewcontroller".
If thats the case your should make a subclass of UITableViewCell and add those 4 views to the subclassed cell.
So that your subclassed cell header would look something like:
#Import <UIKit/UIKit.h>
@interface TicketCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UIStepper *stepper;
@property (weak, nonatomic) IBOutlet UILabel *ammountLabel;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
@end
Then you should set this class as your UITableViews prototype cell class in Interface Builder and then drag and drop the UILabels and the UIStepper into the prototype cell. After that you need to connect the outlets to the right UILabels and UIStepper.
And in your uitableviewcontroller you want to reuse this prototype
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellId= @"PrototypeCellStoryboardIdentifier";
TicketCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (cell == nil) {
cell = [[TicketCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellId];
}
return cell;
}
and finally you want to set the number of rows in your table to the number of objects in your "number-of-ticket-types-array" like this:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [ticketTypes count];
}