title: show label (add some data) when my table view is empty?
body: <p>I have one table view with an add button. When the user presses that add button I add data to the table view, but I when the table contains no data I want to show a label with a message: </p>
  
  <blockquote>
    <p>no data added</p>
  </blockquote>
  
  <p>I am using core data. I have already tried some suggestion from Stack Overflow, but no solution helped.</p>
  
  <pre><code>- (void)viewDidLoad{
  
          nomatchesView = [[UIView alloc] initWithFrame:self.view.frame];
          nomatchesView.backgroundColor = [UIColor clearColor];
  
          UILabel *matchesLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,0,320,320)];
          matchesLabel.font = [UIFont boldSystemFontOfSize:18];
          matchesLabel.minimumFontSize = 12.0f;
          matchesLabel.numberOfLines = 1;
          matchesLabel.lineBreakMode = UILineBreakModeWordWrap;
          matchesLabel.shadowColor = [UIColor lightTextColor];
          matchesLabel.textColor = [UIColor darkGrayColor];
          matchesLabel.shadowOffset = CGSizeMake(0, 1);
          matchesLabel.backgroundColor = [UIColor clearColor];
          matchesLabel.textAlignment =  UITextAlignmentCenter;
  
          //Here is the text for when there are no results
          matchesLabel.text = @"No Matches";
  
  
          nomatchesView.hidden = YES;
          [nomatchesView addSubview:matchesLabel];
          [self.tableView insertSubview:nomatchesView belowSubview:self.tableView];
      }
  
  
  
      - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
      {
          //If there is no table data, unhide the "No  data added" view
          if(catefetchedResultsController == 0 ){
          nomatchesView.hidden = NO;
          } else {
          nomatchesView.hidden = YES;
          }
  
          return [data count];
      }
  </code></pre>
  
  <p>Thanks in advance !</p>