For some reason, my Parse query succeeds, and returns objects, in my AppDelegate.Swift file. However, when I make the same call in viewDidLoad
of the initial view controller, it fails.
Has anyone had a similar issue?
Thanks!
Here is my query:
let query = PFQuery(className: "Houses")
query.findObjectsInBackgroundWithBlock { (objects, error) -> Void in
if error == nil {
print("Succeeded")
print(objects!.count)
} else {
print(error?.description)
}
}
SOLVED: Thanks to @Mo Nazemi in comments.
Parse was not initialized before the query call was made in
viewDidLoad
of root view controller.