0

All I have added this into my appdelegate

var controller:PFQueryTableViewController = PFQueryTableViewController(className: "Types_")
self.window?.rootViewController = controller
println(self.window?.rootViewController)

I have created an new class in swift like this :

class TableViewController: PFQueryTableViewController {

    override init!(style: UITableViewStyle, className: String!) {
        super.init(style: style, className: className)
    }


    required init(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)

        self.parseClassName = "Types_"
        self.pullToRefreshEnabled = true
        self.paginationEnabled = true
        self.objectsPerPage = 5
        //self.textKey = "TypeOfVenue_"
}
    override func queryForTable() -> PFQuery! {

        var query = PFQuery(className: self.parseClassName)

        if (objects.count == 0)
        {
            query.cachePolicy = kPFCachePolicyNetworkOnly
        }

        return query


    }


    override func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!, object: PFObject!) -> PFTableViewCell!

   {

    var cellIdentifier = "eventCell"
    var cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier) as PFTableViewCell!
    if cell == nil {

        cell = PFTableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: cellIdentifier)

    }
    cell.textLabel?.text = object["TypeOfVenue_"] as NSString
    cell.detailTextLabel?.text = object["Seating"] as NSString
    return cell



   }

But the new class does not execute, if i add a breakpoint in the class, it doesn't execute the breakpoint.

I have added a ViewController in the Storyboard, and linked the class to the view controller like this :

enter image description here

Anyone have any ideas ?

1 Answer 1

1

I created a TableView controller on my Storyboard, and removed the code in the app delegate to create the controller.

Then I added this class as the the class on the tableview controller, and it worked.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.