私が持っているtableview私は時々 、リストに何も結果があるではないかもしれないところ、それは「何の成果を」言わないまでに何かを入れたい何の結果が存在しない場合(ラベルまたは1つのテーブルビューセルのいずれかが?)。
これを行う最も簡単な方法はありますか?
私がしようとするだろうlabel後ろtableview結果に基づいて、2つの後、皮1、しかし、私が働いているので、TableViewController通常のをしていないViewController私はどのようにスマートわからないか、つまりなんとか。
私はまたParse、としてサブクラスを使用していPFQueryTableViewControllerます:
@interface TableViewController : PFQueryTableViewController
必要な追加の詳細情報を提供できます。通知してください!
TableViewController ストーリーボードのシーン:

編集: Midhun MPごとに、ここに私が使用しているコードがあります
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
NSInteger numOfSections = 0;
if ([self.stringArray count] > 0)
{
self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
numOfSections = 1;
//yourTableView.backgroundView = nil;
self.tableView.backgroundView = nil;
}
else
{
UILabel *noDataLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.tableView.bounds.size.width, self.tableView.bounds.size.height)];
noDataLabel.text = @"No data available";
noDataLabel.textColor = [UIColor blackColor];
noDataLabel.textAlignment = NSTextAlignmentCenter;
//yourTableView.backgroundView = noDataLabel;
//yourTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tableView.backgroundView = noDataLabel;
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
}
return numOfSections;
}
そして、ここに私が得ているビューがあります、それはまだ区切り線を持っています。これは小さな変更だと感じますが、なぜセパレータ線が表示されるのかわかりません。

numberOfSectionsカウントを返す必要があり、それだけです。も同じですnumberOfRowsInSection。これらはいつでも何度でも呼び出すことができます。ビューを更新したり、データを更新したり、カウントを返す以外のことを行ったりしないでください。ビューを更新するロジックがこれらのメソッドに含まれていてはなりません。





