pfquery

PFQueryTableViewController error

一世执手 提交于 2019-12-04 08:05:42
I'm following a tutorial online for creating a photo sharing app using Parse as a backend. I've run through the tutorial twice, creating the app from scratch both times, and still the same error occurs at the same spot. I've looked high and low for a solution and still no luck. I'm using a PFQueryTableViewController, and my content is being loaded in multiple sections instead of rows. Each section displays PFUser details in the section header, and each section has only one row, which displays the image loaded by that user. At the end of each page (I have pagination enabled, loading 3 objects

How to create a PFQueryTableViewController with Parse in Swift?

梦想与她 提交于 2019-12-03 21:34:46
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, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { //Link to Parse Parse

Add objects to NSMutable array with grouping

泪湿孤枕 提交于 2019-12-02 19:02:34
问题 I want my NSArray sampleData to receive actual data from parse.com database assuming like this: self.sampleData = @[ @{ @"date": @"12/5/2014", @"group": @[ @{ @"text": @"post1", @"location": @"x,y" }, @{ @"text": @"post2", @"location": @"x,y" }, @{ @"text": @"post3", @"location": @"x,y" }, @{ @"text": @"post4", @"location": @"x,y" }, @{ @"text": @"post5", @"location": @"x,y" } ] }, @{ @"date": @"12/3/2014", @"group": @[ @{ @"text": @"post6", @"location": @"x,y" }, @{ @"text": @"post7", @

Array retuning a blank array outside of PFQuery with Parse.

痴心易碎 提交于 2019-12-02 17:19:49
问题 Array returning a blank array when outside of the PFQuery. For some reason, the items are not being passed to the array when compiled. class DriverViewController: UIViewController { var placesArr : Array<Place> = [] override func viewDidLoad() { super.viewDidLoad() self.window = UIWindow(frame: UIScreen.mainScreen().bounds) var query = PFQuery(className:"places") query.whereKey("username", equalTo:"email@email.com") query.findObjectsInBackgroundWithBlock { (objects: [AnyObject]?, error:

Array retuning a blank array outside of PFQuery with Parse.

廉价感情. 提交于 2019-12-02 09:52:29
Array returning a blank array when outside of the PFQuery. For some reason, the items are not being passed to the array when compiled. class DriverViewController: UIViewController { var placesArr : Array<Place> = [] override func viewDidLoad() { super.viewDidLoad() self.window = UIWindow(frame: UIScreen.mainScreen().bounds) var query = PFQuery(className:"places") query.whereKey("username", equalTo:"email@email.com") query.findObjectsInBackgroundWithBlock { (objects: [AnyObject]?, error: NSError?) -> Void in if error == nil { println("Successfully retrieved \(objects!.count) scores.") if let

Add objects to NSMutable array with grouping

拜拜、爱过 提交于 2019-12-02 09:14:27
I want my NSArray sampleData to receive actual data from parse.com database assuming like this: self.sampleData = @[ @{ @"date": @"12/5/2014", @"group": @[ @{ @"text": @"post1", @"location": @"x,y" }, @{ @"text": @"post2", @"location": @"x,y" }, @{ @"text": @"post3", @"location": @"x,y" }, @{ @"text": @"post4", @"location": @"x,y" }, @{ @"text": @"post5", @"location": @"x,y" } ] }, @{ @"date": @"12/3/2014", @"group": @[ @{ @"text": @"post6", @"location": @"x,y" }, @{ @"text": @"post7", @"location": @"x,y" }, @{ @"text": @"post8", @"location": @"x,y" }, @{ @"text": @"post9", @"location": @"x,y"

PFQuery pinAllInBackground:block: never completes

a 夏天 提交于 2019-12-01 08:29:08
问题 I have a Parse app and I want to enable local data store for caching/offline use. In my app delegate, I've set [Parse enableLocalDatastore]; . In my query (to the server), I'm making a normal query, but I'm pinning the results upon fetch: [followingsQuery findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { [PFObject pinAllInBackground:objects block:^(BOOL succeeded, NSError *error) { NSLog(@"er: %@", error); }]; ... //rest of my handler }]; However, the completion block (

PFQuery by date

折月煮酒 提交于 2019-11-29 12:30:55
I'm trying to search for all results that contain a certain date (no time) with a PFQuery. I can't seem to figure out why it is not working. My code I am using is below. NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init]; [dateFormat setDateFormat:@"YYY-MM-dd"]; NSString *today; today = [dateFormat stringFromDate:[NSDate date]]; PFQuery *query = [PFQuery queryWithClassName:@"Booking"]; [query whereKey:@"nextAppointment" equalTo:today]; [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { if (!error) { etc etc... The field nextAppointment is set as a date

Parse.com querying User class (swift)

六月ゝ 毕业季﹏ 提交于 2019-11-28 12:21:16
I encounter some strange problem when I try to query all users from the "User" class It dos not find any Users var query:PFQuery=PFQuery(className: "User"); query.findObjectsInBackgroundWithBlock { (objects: [AnyObject]!, error: NSError!) -> Void in if !(error != nil) { for(var i=0;i<objects.count;i++){ var object=objects[i] as PFObject; var name = object.objectForKey("username") as String; println(name); } } } I tried replacing var query:PFQuery=PFQuery(className: "User"); with var query:PFQuery=PFQuery(className: "AnotherClass"); and everything worked like i should. I think it must be

Parse: How do I query using PFRelation when I just have PFUser?

空扰寡人 提交于 2019-11-28 10:21:28
问题 Here is an example of what I am trying to do. I have the current user as PFUser and on another class named Item I have a relation named "owners" which is a relation of PFUser. I want to query for all instances of Item which have the current user in the relation. I see examples of the opposite way of querying, but I do not see how to get a relation and then filter it to a PFUser match on the relation. Here is one example. https://www.parse.com/questions/inverse-relationship-support PFObject