I am reposting this question, hoping to get some responses. I am at a loss as to how to display possession items under value $50 in one section and over $50 in another section.
Here is what I am doing in my implementation section.
@implementation ItemsViewController
-(id) init
{
// Call the superclass's designated initializer
[super initWithStyle:UITableViewStyleGrouped];
// Create an array of 10 random possessions objects
possessions = [[NSMutableArray alloc] init];
possessions2 = [[NSMutableArray alloc] init];
for (int i=0; i <5; i++) {
if ([[Possesions randomPossession] valueInDollars] < 50) {
[possessions1 addObject:[Possesions randomPossession]];
}
else {
[possessions2 addObject:[Possesions randomPossession]];
}
//z[possessions addObject:[Possesions randomPossession]];
}
return self;
}
And, to create 2 sections, I am using
-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView
{
return 2;
}
Could you please give me some directions on how to assign the correct entries to correct section?
Thank you.