I've already got an array of dictionary (for loan items), example below:
(
{
BIBNo = 291054;
date = "10/08/2012";
itemSequence = 000010;
name = "iPhone application development for IOS 4 / Duncan Campbell.";
noOfRenewal = 1;
number = 000291054;
status = "Normal Loan";
time = "24:00";
type = Loans;
},
{
BIBNo = 187883;
date = "13/08/2012";
itemSequence = 000010;
name = "Positive thinking / Susan Quilliam.";
noOfRenewal = 2;
number = 000187899;
status = "Normal Loan";
time = "24:00";
type = Loans;
},
{
BIBNo = 290408;
date = "13/08/2012";
itemSequence = 000010;
name = "Sams teach yourself iPhone application development in 24 hours / John Ray.";
noOfRenewal = 1;
number = 000290408;
status = "Normal Loan";
time = "24:00";
type = Loans;
})
And right now I need to insert them into tables, with date as the section and rows classified into section accordingly to the date. I've gone through many tutorials but however, most of the tutorials just uses static hardcode of the sections and rows which looks something like that:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (section == 0){
return 1;
}
else if (section == 1){
return 5;
} }
Because the loan items array is dynamic, therefore i cannot hardcode the rows nor the sections to return certain values. Anyone can highlight to me how should I carry on so that I can return dynamic values? If possible, examples would be appreciated! Thanks all :)