swift - prepare for segue.. from UITableView to DetailView with parse Objects -


trying uitableviewcontroller detail view controller these pfobjects...thanks in advance!

error can't seem reconcile..."cannot subscript value of type 'string' index of type 'string'"

i want queried objects present on detail view controller...

here query , prepare segue...i can't seem access objects in prepare segue...

    var customername = [string]()     var customeraddress = [string]()    var query = pfuser.query   query.wherekey("userid",equalto:adminfollowinguser)   query.findobjectsinbackgroundwithblock({ (adminobjects, error) -> void in            if let objects = adminobjects {              object in objects {    self.customername.append(object["customername"] as! string)   self.customeraddress.append(object["customerstreetaddress"] as! string) 

// here prepare segue....

      override func prepareforsegue(segue: uistoryboardsegue, sender:       anyobject?)       {        if (segue.identifier == "thesepools")       {         let employeedetailvc: employeedetailviewcontroller =  segue.destinationviewcontroller     as! employeedetailviewcontroller   // indexpath set path tapped   let indexpath = self.tableview.indexpathforselectedrow    let customernamelabel = self.customername[indexpath!.row]   let customeraddresslabel = self.customeraddress[indexpath!.row]  employeedetailvc.customerstring = customernamelabel   employeedetailvc.addressstring = customeraddresslabel 

here detail view controller receiving strings.

       //detailviewcontroller       var customerstring = string()    var addressstring = string()    override func viewdidload() { super.viewdidload()  self.customerlabel.text = customerstring self.addresslabel.text = addressstring 

var currentobject = string() string , set string in prepareforsegue.this should trick: self.customertextfield.text = curentobject , remove other stuff.


Comments