I am trying to draw the number of rows according to which section they are in. Code:
-(void)configureView:(NSDictionary *)serverResult{
NSManagedObject * detailData = [serverResult valueForKey:@"details"];
NSSet * projID = [detailData valueForKey:@"PROJECTID"];
NSSet * projStat = [detailData valueForKey:@"PROJECTSTATUS"];
NSSet * appDate = [detailData valueForKey:@"BOARDAPPROVALDATE"];
NSSet * closeDate = [detailData valueForKey:@"LOANCLOSINGDATE"];
NSSet * countryName = [detailData valueForKey:@"COUNTRYNAME"];
NSSet * regionName = [detailData valueForKey:@"REGIONNAME"];
NSSet * envCatCode = [detailData valueForKey:@"ENVASSESMENTCATEGORYCODE"];
NSSet * teamLeader = [detailData valueForKey:@"TEAMMEMFULLNAME"];
NSSet * borrower = [detailData valueForKey:@"BORROWER"];
NSSet * impAgency = [detailData valueForKey:@"IMPAGENCY"];
NSSet * totalCost = [detailData valueForKey:@"LENDINGPROJECTCOST"];
NSSet * comtAmt = [detailData valueForKey:@"IBRDPLUSIDAAMT"];
basic = [NSArray arrayWithObjects:projID, projStat, appDate, closeDate,countryName,regionName,envCatCode,teamLeader,borrower,impAgency,totalCost,comtAmt, nil];
}
- (NSInteger)tableView:(UITableView *)tv numberOfRowsInSection:(NSInteger)section
{
int number;
switch (section) {
case 0:
number = basic.count;
break;
case 1:
number = allSectors.count;
break;
case 2:
number = 1;
break;
default:
break;
}
return number;
}
But code crashes with EXC_BAD_Access Please help!!!