当我的表视图为空时显示标签(添加一些数据)?

时间:2015-09-02 21:39:00

标签: ios tableview

我有一个带有添加按钮的表格视图。当用户按下该添加按钮时,我将数据添加到表视图中,但是当表中没有数据时,我想要显示带有消息的标签:

  

没有添加数据

我正在使用核心数据。我已经尝试过Stack Overflow的一些建议,但没有任何解决方案有帮助。

<html>
    <head>
    <meta    charset="utf-8">
    <link href="d3-geomap/css/d3.geomap.css" rel="stylesheet">
    <script src="d3-geomap/vendor/d3.geomap.dependencies.min.js"></script>
    <script src="d3-geomap/js/d3.geomap.min.js"></script>
    </head>
    <style>
    path.unit:hover{
    fill:red;
}
</style>
    <body>
        <div id="map"></div>
    </body>
    </html>

     <script>
     var map = d3.geomap.choropleth()
    .geofile('d3-geomap/topojson/countries/USA.json')
    .projection(d3.geo.albersUsa)
    .column('2012')
    .unitId('fips')
    .scale(1000)
    .legend(true);

    d3.csv('data.csv', function(error, data) {
    d3.select('#map')
        .datum(data)
        .call(map.draw, map);
    });

    </script>

提前致谢!

1 个答案:

答案 0 :(得分:0)

您的View必须是UITableView的tableFooterView或tableHeaderView:

self.tableView.tableFooterView = noMatchesView
相关问题