last day (15 days later) » 

2:07 AM
0
A: prepare for segue.. from UITableView to DetailView with parse Objects

LamarTry that let nav = segue.destinationViewController as! CustomerDetailViewController var indexPath :NSIndexPath = self.tableview.indexPathForSelectedRow()! var object = self.CustomerName[indexPath.row] as! String nav.currentobject = object

 
getting the same error with the your code..."does not have member named objects"...for some reason I'm not able to access the objects in my query....can i nest the prepare for segue in my query so it knows what objects its getting?
 
objects is the array that you have save the things you query from parse you know that right. in your case it should be customerName or customAddress
i update the code it should be the name of the array you are using
 
I'm having issues with casting... since i saved them to the array as strings...i can't cast them as PFObjects with var object :PFObject = self.customerName[indexPath.row] as! PFObject. i think were close!
 
var object = self.customerName[indexPath.row] as! String try that
 
i updated the code for what i currently have...almost there...just somethings off with trying to get a string out of an indexed string...wierd..still researching it
 
2:07 AM
what kind of datatype did you set up in the detail ViewController
 
Hey man, the data type i have in the detail view controller is just String
 
yeah
can you put your project up
i could take a quick look at it
 
picture of the tableview code?
 
yeah
 
where do i add a picture in the chats
first chat I've done
 
2:10 AM
same here lol
let me look
for something
give me a second
 
hahah dangit...well I'm actually about to head out the door with the wifey! ha you going to be on later tonight or tomorrow?
 
just put your code on it
i will take a look at it
 
heading out the door! thanks for looking at it lamar! appreciate it! chat soon!
ill keep the window open :) that website is frigin sick! great google search :)
 
ok
import UIKit
import Parse
import ParseUI

class EmployeesPools: UITableViewController {


var customerName = [String]()
var customerAddress = [String]()


override func viewDidLoad() {
super.viewDidLoad()

let getAdminquery = PFQuery(className: "Employee")
getAdminquery.whereKey("companyEmployee", equalTo: PFUser.currentUser()!.objectId!)
getAdminquery.findObjectsInBackgroundWithBlock { (objects:[AnyObject]?, error:NSError) -> Void in

if error == nil {

if let objects = objects as![PFObject] {
 
 
3 hours later…
5:10 AM
hey man thanks for the edits! the only errors I'm getting are on the receiving end on the detail view controller...im using Xcode 7 beta and a lot of the implicit unwrapping of ! gave me errors and made me take them out....literally downloaded it today so still getting the hang out it. i didn't create an IBOutlet for the tableview though...dont think i have...im quite new to swift and programming so forgive my lack of knowledge on some of this. heres what i have on my detail view controller...
import UIKit
import Parse
import ParseUI


class EmployeeCustomerDetailViewController: UIViewController {

// Container to store the view table selected object
var currentObject = String()



@IBOutlet weak var customerTextField: UITextField!

@IBOutlet weak var customerAddressTextField: UITextField!


override func viewDidLoad() {
super.viewDidLoad()


scrollView.keyboardDismissMode = .OnDrag

// Unwrap the current object object
let object = currentObject

if object["customerName"] != nil {
self.customerTextField.text = object["customerName"]
heading to bed ill be on tomorrow! thanks again for the help bud!
 

  last day (15 days later) »