pfquery

Why does my Parse Query succeed in AppDelegate, but not in ViewController?

点点圈 提交于 2019-12-13 04:38:31
问题 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) } } 回答1: SOLVED: Thanks to @Mo Nazemi in comments.

PFQuery Only Returning 100

我是研究僧i 提交于 2019-12-13 03:04:46
问题 I thought that the PFQuery was supposed to have a limit of 1000, but I am having an issue of it only returning 100 objects using this code: - (id)initWithCoder:(NSCoder *)aDecoder { NSLog(@"initwithcoder"); self = [super initWithCoder:aDecoder]; if (self) { NSLog(@"self"); // The className to query on self.parseClassName = @"Directory"; // Whether the built-in pull-to-refresh is enabled self.pullToRefreshEnabled = YES; // Whether the built-in pagination is enabled self.paginationEnabled = NO;

PFQueryTableViewController text of cell issue

佐手、 提交于 2019-12-13 02:24:52
问题 First, let me explain what it is that I am trying to do. I have three classes: User, Show and ShowAssignments. ShowAssignments has two relational columns, one that stores a Show and one that stores a User. I have a PFQueryTableViewController that runs a query sorting through the ShowAssignments table looking for all rows that belong to the current user. Then, I want to display the Name of each Show (the Show table has a Name field) in the cells of the table. Here is my code: required init

'queryForTable' cannot return 'nil' In Swift

人走茶凉 提交于 2019-12-12 18:13:37
问题 I am using PFQueryTableViewController as part of ParseUI to load a table of objects based on the currentUser's geolocation. I have seen several other (older) forum posts (like here) detailing that the queryForTable function should return nil if a value like currentLocation:PFGeoPoint? is nil. Then wait on the background process in viewDidLoad to get the PFGeoPoint and loadObjects() , thus calling the queryForTable function again. I am seeing others say that Swift's ParseUI libraries may not

Query with pointer User in Parse.com

江枫思渺然 提交于 2019-12-12 14:15:54
问题 I am using Parse.com in my app, I have created a "Post" class and inside I have a pointer that specifies which user sent the post. Now I seeing on the timeline to the Post and the time the user name who created the post. Since the user is a pointer I can not make a correct query, do you know how can I fix this issue? 回答1: The trick is to use PFQuery includeKey to have the related pointer data automatically filled by Parse. The user data will be downloaded without requiring you to make another

Object not found for update error Parse Swift

妖精的绣舞 提交于 2019-12-12 04:18:01
问题 I'm using parse on Xcode 7.2 and I'm having trouble updating the object with swift. I want to update my boolean value in parse class column "Approve" and my class name is "Request" and I have "FromUserName" column which is type String and "ToUsername" column which is String as well This is my code in swift func block(){ let name = self.userDelName let query = PFQuery(className: "Request") //let username = PFUser.currentUser()?.username! if let username = PFUser.currentUser()?.username! {

Parse.com Query Limit - Effects whereKey Limit?

廉价感情. 提交于 2019-12-12 03:23:42
问题 I understand that with parse there is a PFQuery limit where you can only retrieve 1000 objects at a time. I presume it doesn't, but does this also limit the number of whereKey comparisons that can be carried out. E.g. var query = PFQuery(classname: "Photos") query.whereKey("Name", equalTo: someString) query.findObjectsInBackgroundWithBlock() If there are more than 1000 objects in the class, will the whereKey comparison stop after it has compared 1000 objects, or is the issue with only

swift parse query get last createdAt objects

拟墨画扇 提交于 2019-12-12 02:46:25
问题 I have did a lot of querys, searched in websites , And already asked this question before and i didn't found a good answer! I have Parse backend looks like this: In my view controller I just want to show Last createdAt for each sender i want to get all the row of last object for sender:. so we should ignore "name1: Hello" and "name2: Really when was.." because this old rows we already got new objects. I want one result for each sender depends on createdAt so can I get help with query to do

trying to access the subscript of a Parse query array in SWIFT

送分小仙女□ 提交于 2019-12-12 01:49:36
问题 I am having difficulty accessing the subscript at point zero of an array of objects that has been queried from Parses database. Code: var query = PFUser.query() query.whereKey("location", nearGeoPoint: geopoint, withinMiles: self.distance) query.whereKey("objectId", notContainedIn: self.matches) query.whereKey("objectId", notEqualTo: self.user.objectId) query.limit = 500 var objects = query.findObjects() if objects != nil { for object in objects { var closestUsers = object as PFUser var

How to get the PFRelation objects while getting the PFquery objects?

ε祈祈猫儿з 提交于 2019-12-11 19:22:21
问题 NSPredicate *predicate=[NSPredicate predicateWithFormat:@"(UserId==%@)",[defaluts objectForKey:@"objectId"]]; PFQuery *frndquery=[PFQuery queryWithClassName:@"FriendsDetails" predicate:predicate]; [frndquery orderByDescending:@"lastdate"]; [frndquery whereKey:@"BlockStatus" equalTo:@"No"]; NSArray *arrquery=[frndquery findObjects]; for (PFObject *frndids in arr){ PFRelation *relation=[frndids relationforKey:@"ChatRelation"]; NSArray *arrids=[NSArray arrayWithObjects:[frndids objectForKey:@