这次真的不知道到哪里去找这个问题了。
我有一个带有嵌入式 UITableView 的 UIViewController。我已将 UITableViewDelegate、UITableViewDataSource 添加到我的头文件中。在实现文件中,我导入了另一个用于读取/写入数据库的类的头文件。
在我的实现文件的“numberOfRowsInSection”部分有这个代码:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
DbOperations *medi = [[DbOperations alloc] init];
self.orari = [medi ProssimeMedicineGrouped];
return [self.orari count];
}
我在此方法的开头添加了一个断点,然后我发现根本没有调用“ProssimeMedicineGrouped”方法。
昨天它工作没有问题。我所做的唯一更改是将 ViewController 从仅包含表的 UITableViewController 更改为嵌入了 tableView 的 UIViewController。