pfquery

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

﹥>﹥吖頭↗ 提交于 2019-12-25 03:55:04
问题 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

Parse Pagination Not Working

冷暖自知 提交于 2019-12-24 20:04:16
问题 In my app, I use Parse. I have it set up like this: - (id)initWithCoder:(NSCoder *)aDecoder { self = [super initWithCoder:aDecoder]; if (self) { // The className to query on self.parseClassName = @"Prayers"; // Whether the built-in pull-to-refresh is enabled self.pullToRefreshEnabled = YES; // Whether the built-in pagination is enabled self.paginationEnabled = YES; // The number of objects to show per page self.objectsPerPage = 20; } return self; } - (PFQuery *)queryForTable { PFQuery *query

PFQueryTableViewController with 3 Sections

六眼飞鱼酱① 提交于 2019-12-24 11:37:33
问题 I have a 'Game' table in my parse database with the following relevant columns: isOver (Boolean) whoseTurn (Relation:_User) (Games can have multiple players, so it can be more than one person's turn at the same time) players (Relation:_User) I need to query this table and display the results in 3 separate sections of the tableview: 'My Turn' 'Their Turn' 'Game Over' I was thinking of using the following query coupled with some of the code in the answer given here: https://parse.com/questions

Loading 3 Different Information to 3 Different types of Cells

无人久伴 提交于 2019-12-24 05:46:09
问题 I have three different types of cells in a tableViewController. I get which type of cell to have and an objectId of an item from a different class. I then go to each cell in the cellForRowAt method and load whatever the data is. This method has led me to 2 problems: 1) the dynamic height of one of the cell does not work because it's label's text is not found until after the cell is made. 2) All the cells have a "jumpy" (I can see the rows being populated as I scroll down, I guess because its

IOS Parse how do I retrieving objects from a query based on two classes?

谁都会走 提交于 2019-12-22 00:24:41
问题 I have two classes User and Post . The User class has a userType field and I want to retrieve all of the posts from a given userType lets call them group x. In the Post class I have a pointer to the User class. I was trying to do something like, first retrieve all user Ids for the type of user I want: PFQuery *queryUser = [PFQuery queryWithClassName:kFTUserClassKey]; [queryUser whereKey:kFTUserTypeKey equalTo:kFTUserTypeX]; [queryUser whereKey:kFTUserLocationKey nearGeoPoint:nearGeoPoint

PFQueryTableView Auto Refresh When New Data Updated or Refresh Every Minute Using Parse

好久不见. 提交于 2019-12-21 22:23:48
问题 Currently Im following this tutorial http://www.appcoda.com/ios-programming-app-backend-parse/ But I want the tableviewcontroller to be refresh with new data when data from parse.com is update automatically. I don't want the user to always have to pull to refresh. or maybe having time refresh every minute? I heard about reloaddata but how to implement the code? - (id)initWithCoder:(NSCoder *)aCoder { self = [super initWithCoder:aCoder]; if (self) { // The className to query on self

How to create a PFQueryTableViewController with Parse in Swift?

前提是你 提交于 2019-12-21 05:35:24
问题 I've imported all the frameworks required but from that point on I don't quite know what to do (I'm new to Swift and no absolutly nothing about Objective C). Parse docs aren't in Swift yet so can someone please provide me with a starting point? I've initialized my view controller (which doesn't appear when I run the app, I just get a black screen; but based on this video, I should see a table: https://parse.com/tutorials/parse-query-table) func application(application: UIApplication,

Setting PFObject in to UILabel

折月煮酒 提交于 2019-12-13 06:54:40
问题 I have created a PFObject named UserInfo. Everything saves to Parse correctly, but when I go to retrieve it I keep getting errors. Here is my code below. PFQuery *query = [PFQuery queryWithClassName:@"UserInfo"]; [query whereKey:@"user" equalTo:currentUser]; [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { if (error) { NSLog(@"Error: %@ %@", error, [error userInfo]); } else { self.userInfo = objects; NSLog(@"%@", self.userInfo); self.locationDisplay.text = [self

Setting Parse Pointer to Class Other than PFUser

荒凉一梦 提交于 2019-12-13 06:36:31
问题 I am trying to set a pointer from an object in "Classes" to an object in "Schools". When I do so, I get this error: invalid type for key school, expected *Schools, but got string (Code: 111, Version: 1.12.0) I know that the error is saying that it expects a pointer for class, "Schools", but it got a string instead. Here is my code: let schoolObjectIdQuery = PFQuery(className:"Schools") schoolObjectIdQuery.whereKey("school_name", equalTo: "\(PFUser.currentUser()!.objectForKey("school_name")!)"

Objective c parse, count objects in background

孤街醉人 提交于 2019-12-13 04:59:25
问题 I try to get the number of queries I found in background. So I use countobjects method to get the number, but system has warning about it "A long-running operation is being executed on the main thread." PFQuery *query2=[PFQuery queryWithClassName:@"Comments"]; [query2 whereKey:@"Name" equalTo:globalName]; NSInteger CommentPoint=query2.countObjects; so i change to this method, but i can't get numbers of count print in my console. [query2 countObjectsInBackgroundWithBlock:^(int count, NSError