pfquery

PFQueryTableViewController not showing custom cells

馋奶兔 提交于 2020-01-16 12:42:48
问题 I have a subclass of PFQueryTableViewController that I am trying to show in a container view (as a subview). My problem is that I cannot get the custom cells to show in the tableview. I have verified the following via debugging: The tableview is being added to the parent view The tableview is a PFQueryTableView Controller as it includes the default pull to refresh The PFQuery is returning the correct number of objects The CellForRowAtIndexPath method is being called and iterating through the

Using a variable as a key for a PFQuery to filter out users. Swift Querying a User

╄→尐↘猪︶ㄣ 提交于 2020-01-07 03:10:08
问题 Variable in a User class as a string. Using this variable as a key for a PFQuery and use it to filter out the users that don't have it.I need to skip users that don't have it and add the users that do to the VC display. Here is my code so far: In the VC where the variable is stored I have: var genreSearch: NSString? after viewDidLoad in a cell I have: let genreSearch = table_data[indexPath.row] userDefaults.setObject(genreSearch, forKey: "genre") print(genreSearch)` Then on the VC where the

Swift Converting PFQuery to String Array for TableView

南笙酒味 提交于 2020-01-06 21:09:30
问题 I am trying to query all of the Parse users in my database and then display each individual user in their own cell in a tableview. I have set up my tableview, but I'm stuck on saving the user query to a string array that can be used within the tableview. I have created a loadParseData function that finds the objects in the background and then appends the objects queried to a string array. Unfortunately I am given an error message on the line where I append the data. Implicit user of 'self' in

How to make a PFQueryTableView work inside a UIViewController

冷暖自知 提交于 2020-01-06 12:47:39
问题 I'm trying to figure out how to get the benefits of the PFQueryTableViewController to work inside of a a regular UIViewController that has a TableView embedded in it. Because apparently I can't load data from parse onto my TableView. It just pops up as a blank tableView with none of my information from Parse in it unless the code is ran on a UITableViewController, then it has no problems. But I'm trying to get my program to run on a Table View thats in a UIViewController. And whenever I

Parse.com Query: Cache is always empty (iOS)

柔情痞子 提交于 2020-01-05 14:25:42
问题 I'm writing an iOS-App using Parse.com as a backend. In the - (PFQuery)queryForTable method of my PFQueryTableViewController I'm retrieving a set of data from Parse, but I'm unable to cache this query in order to support functionality when the device is currently offline. The method looks as followed: - (PFQuery *)queryForTable { PFQuery *query = [PFQuery queryWithClassName:self.parseClassName]; [query whereKey:@"city" equalTo:[[NSUserDefaults standardUserDefaults] objectForKey:@"city"]]; //

doesNotMatchKey:inQuery: return records that match key in Parse SDK for iOS

戏子无情 提交于 2020-01-04 03:18:13
问题 I'm trying to do a simple query in xcode using the Parse SDK where I am showing products to users but i don't want to show them products they've already "liked." So I have two tables in Parse that I'm using: - Products: has an objectId - Likes: contains columns: Like (says yes/ no), Pointer to a product, Pointer to a user Any my code is: //query will get products that the user has liked PFQuery *likeQuery = [PFQuery queryWithClassName:@"Likes"]; [likeQuery whereKey:@"User_Obj" equalTo:[PFUser

Retrieving an array from Parse.com

三世轮回 提交于 2019-12-25 08:19:18
问题 I am trying to download an array from Back4Apps.com (Parse.com equivalent). The below displays no errors, but when it gets to the line "downloadQuery.findObjectsInBackground { (objects, error) in", it simply skips over the rest of the code to the end of the function. I have tested the "username" and it seems to be correct. I am certain the class and subClass names are correct. The parse parameters are correct and I already have many other parse functions working. Any suggestions where to look

Parse - Query after a specific row

前提是你 提交于 2019-12-25 07:15:43
问题 How can I query after a specific row where the objectId is equal to a objectId I have stored? This is my query code: func queryStory(){ let query = PFQuery(className: "myClassStory") query.whereKey("isPending", equalTo: false) query.limit = 1000 query.orderByDescending("createdAt") query.findObjectsInBackgroundWithBlock { (posts: [PFObject]?, error: NSError?) -> Void in if (error == nil){ // Success fetching objects for post in posts! { if let imagefile = post["userFile"] as? PFFile { self

Search in PFQueryTableView not working

纵饮孤独 提交于 2019-12-25 05:31:52
问题 I have PFQueryTableView with UISearchBar to search users from my user class on Parse server but I never get it working. Here is my code: SearchViewController.h #import <Parse/Parse.h> @interface PAWUserSearch1ViewController : PFQueryTableViewController @end SearchViewController.m #import "SearchViewController.h" #import "PAWAppDelegate.h" @interface SearchViewController () <UIGestureRecognizerDelegate, UISearchBarDelegate, UISearchDisplayDelegate> @property (strong, nonatomic) IBOutlet

Parse, how to count, put data in an array, then show the content of the array

烈酒焚心 提交于 2019-12-25 03:55:51
问题 I need to check for, and then show, the number of objects in a Parse class in a fixed tableView, each object has a "guide" keyword, and each row of the tableView is named after those keywords. problem: Can't add data to the array my idea is to search for them, put result in an array: var totalOfTotalArray : [Int] = [] and then, in order to show numbers one by one, each row will have: switch indexPath.row { cell.guideNumberOfMexLabel.text = String(self.totalOfTotalArray[indexPath.row]) } this