페이지

2012년 10월 23일 화요일

countForCategoryIndex

하이라이팅 이쁘게 해서 영어로 피드백 보냈는데,
과연 소중하게 받아들여질까?



- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [[AddressBook sharedAddressBook] countInSection:section];
}


- (NSInteger)countInSection:(NSInteger)section
{
int count = 0;
if(section >= 0 && section < [categories count])
    {
        NSString *qry = [NSString stringWithFormat:@"SELECT count(*) FROM t_contacts WHERE recordId is not null and consonant LIKE '%@%%' AND groupNames LIKE '%%%@%%' %@",
[categories objectAtIndex: section],filterGroup,filterText];
        
FMResultSet *rs = [database executeQuery:qry];
while([rs next]) {
count = [rs intForColumnIndex:0];
break;
}
[rs close];
}
else
    {
count = 0;
}
    
return count;
}

댓글 없음:

댓글 쓰기