stephen D stephen D - 1 year ago 56
Swift Question

Why do I get a "Value of type 'TableViewController' has no member 'place' ''?

I am tying to download some data from parse (a string) and I get the error

"Value of type 'TableViewController' has no member 'place'
on the line that says :!)

I have this as a global var :

var place = [""]

and this is my code in the ViewDidLoad:

let query = PFObject.query()
query!.findObjectsInBackgroundWithBlock ({ (objects, error) in

if let skateparks = objects {

for object in skateparks {

if let spotdetail = object as PFObject! {!)







What can I change to make it work as I don't understand why it doesn't recognize the
var place
as it is in the same view controller (tableView)


Answer Source

Everywhere in closure you should use self keyword for properties:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download