title: iOS Swift : Tableview data disappear when i scroll it
body: <p>I have started Swift programming and little confuse about the tableview Control. For implementation i write following code, but the data goes disappear when i scroll it.</p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController {
  
      @IBOutlet  var tblView: UITableView
  
      var Array = ["1","2","3","4","5"]
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          tblView.registerClass(UITableViewCell.self, forCellReuseIdentifier: "cell")
          // Do any additional setup after loading the view, typically from a nib.
      }
  
      override func didReceiveMemoryWarning() {
  
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  
  
      @IBAction func moveToNextView(sender: AnyObject) {
  
          var objNextViewController : NextViewController = NextViewController(nibName: "NextViewController", bundle: nil)
          self.navigationController.pushViewController(objNextViewController, animated: true)
  
      }
  
      func tableView(tableView: UITableView!, numberOfRowsInSection section: Int) -&gt; Int {
          return Array.count
      }
  
      func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -&gt; UITableViewCell! {
  
          //var cell : UITableViewCell! = UITableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: "cell")
  
          var cell:UITableViewCell = tblView.dequeueReusableCellWithIdentifier("cell") as UITableViewCell
          var lblPrint : UILabel! = UILabel(frame: CGRectMake(10, 10, 100, 100))
          lblPrint.text = Array[indexPath.row]
          cell.contentView.addSubview(lblPrint)
  
          return cell
      }
  
  }
  </code></pre>
  
  <p>what could be the right method to write for the above code?</p>
  
  <p>Thanks</p>