Thursday 15 July 2010

ios - Value's from plist to tableView -


I'm trying to use a plist to fill my table view. I have currently written this code. I have no errors and I can fix the application. The problem is that the tableview remains empty. My println returns all the values ​​from my plist tho if I request them out of my scene I do not have any deodelation function. Any thoughts that I am doing wrong? Sorry to ask almost the same questions as my last one. It is just that I am trying to teach myself a new language.

  Import UIKit Class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {var Artist: Array & lt; String & gt; = [] Variable steps: array & lt; String & gt; = [] Override Funk VisualDidload () {super.viewDidLoad () // Make any additional setup after loading the view, especially with a nibb. Path = NSBundle.mainBundle (). PathForResource ("TableRowInfo", type: "plist")! Let be the = NSDictionary (contentoff file: path)! Artists = dict ["Artist"] as Array & lt; String & gt; Stages = Term ["Stage"] as Array & lt; String & gt; Println (artist) println (phase)} did the overdose funk done Receive memory warning (super.didReceiveMemoryWarning ()} function table view (table view: UITableView, numberOfRowsInSection section: int) - & gt; Int {return artists.count} Fanconviews (Tableview: UITableView, CellularEurrentExpath indexpath: NSIndexpath) - & gt; UITableViewCell {var cell = tableView.dequeueReusableCellWithIdentifier ("InfoCell", forIndexPath: indexPath)? UITableViewCell if cell == zero {cell = UITableViewCell (style: subtitle, reuseIdentifier: "InfoCell") cell! .accessoryType = .DisclosureIndicator} cell? .textLabel? .text = Artist [indexPath.row] cell? .detailTextLabel ?. Text = step [indexPath.row] Return Room! }}  

Thanks in advance.


No comments:

Post a Comment