我的(和) 中有two arrays
(first names, Last names)我想在这个. 我用两个字符串创建了类。TableView
cell.textLabel
cell.detailTextLabel
TableView
@interface clientContent : NSObject { }
@property (nonatomic, strong) NSString *clName;
@property (nonatomic, strong) NSString *clLast;
@end
然后我在主类(有表视图)中创建了数组并添加了这样的信息
for (int i = 0; i < PQntuples(clientQuery); i++)
{
clientContent *cc = [[clientContent alloc] init];
cc.clName = [[NSString alloc] initWithUTF8String:PQgetvalue(clientQuery, i, 0)];
cc.clLast = [[NSString alloc] initWithUTF8String:PQgetvalue(clientQuery, i, 1)];
[allClients addObject:cc];
}
在此之后,我将其加载到tableView
;
clientContent *cc = [allClients objectAtIndex:indexPath.row];
cell.textLabel.text = cc.clName;
cell.detailTextLabel.text = cc.clLast;
}
然后我用
-(BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString
如何使它正确?看不懂。。