I have a table view which I am populating after fetching data from my API. But now I am getting an error message "Editor placeholder in source file". I simply just can't get where am I doing the mistake. Please give some idea?
here is my code -
import UIKit
class ViewController: UIViewController,UITableViewDelegate,UITableViewDataSource
{
@IBOutlet weak var tblvww: UITableView!
var dict = [:]
override func viewDidLoad()
{
super.viewDidLoad()
func fetchdata()
{
let url = NSURL(string: "***")
let request = NSURLRequest(URL: url!)
let urlsession = NSURLSession.sharedSession()
let jsonquery = urlsession.dataTaskWithRequest(request) { (data, response, error) -> Void in
if let retrieveddata = data
{
self.dict = (try! NSJSONSerialization.JSONObjectWithData(retrieveddata, options: NSJSONReadingOptions.MutableContainers)) as! NSDictionary
}
}
jsonquery.resume()
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int
{
return dict.count
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
{
let cell = tableView.dequeueReusableCellWithIdentifier("cellreuse", forIndexPath: indexpath) as! CustomTableViewCell `[![//here I get the error "Editor placeholder in source file"][1]][1]`
let vendorname = dict.valueForKey("vendor")?.objectAtIndex(0).valueForKey("name")
cell.vndrlbl.text = vendorname as? String
return cell
}
}
I have also attached a screenshot of my project to make things more clear