pfquery

How to Fetch all data in a table using PFQuery in iOS?

。_饼干妹妹 提交于 2019-12-11 11:46:12
问题 i am newbie here in iOS and Parse Framework i want to fetch data from my Parse table from PFQuery like as NSUInteger limit = 1500; PFQuery *query = [PFQuery queryWithClassName:@"MapInfo"]; [query setLimit: limit]; [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { if (!error) { NSLog(@"Successfully retrieved: %@", objects); } else { NSString *errorString = [[error userInfo] objectForKey:@"error"]; NSLog(@"Error: %@", errorString); } }]; it is Working as i want but

Efficient way to query

荒凉一梦 提交于 2019-12-11 02:26:17
问题 My app has a class that saves picture that users upload. Each object in the class has a city property that holds the name of the city that the picture was taken at, and a like property that tracks the number of likes. I want to be able to send a query that returns one picture per city and each picture should have the highest ranking of likes in the city it belongs to. How can I do that? One way which I first thought about is doing multiple queries by fetching the most liked picture of a city

Parse iOS how query object by properties found in related PFObject?

半世苍凉 提交于 2019-12-10 18:33:29
问题 I am writing an iOS app and I am using Parse to store data on the server side. I have Users and each user can have a Car. I am trying to figure out how to write a query that allows me to get all users that have a car with year less than 2000 and with a certain color (lets say red). Each car has a relationship to the user and each user also has a relationship to their car. User <-> Car (one to one) I started using the PFQuery: PFQuery * userQuery = [PFQuery queryWithClassName:@"User"]; I am

How to save data from parse to a NSArray iOS

走远了吗. 提交于 2019-12-08 12:46:12
问题 How can I save data from parse to an NSArray in the below format. which is being used to populate a UITableView , which is to be used for a search bar. _candyArray = [NSArray arrayWithObjects: [Candy candyOfCategory:@"chocolate" name:@"chocolate bar" mName:@"test1"], [Candy candyOfCategory:@"chocolate" name:@"chocolate chip" mName:@"test1"], [Candy candyOfCategory:@"chocolate" name:@"dark chocolate" mName:@"test1"], [Candy candyOfCategory:@"hard" name:@"lollipop" mName:@"test1"], [Candy

Parse getDataInBackgroundWithBlock not fetching in order

戏子无情 提交于 2019-12-08 10:06:37
问题 I am fetching a string, NSDate and a PFFile from my Parse class to populate the collection view cells All the cells load with image, date, info correctly. The info and date are ordered correctly (by ascending date). But every now and then when I build some of the images will be in a different cell. Im really scratching my head with this. Im guessing it has something to do with how I'm calling mixPhoto.getDataInBackgroundWithBlock({ I did try and use dispatch_async(dispatch_get_main_queue())

Android - Parse query to get all posts and the users to go with the posts

回眸只為那壹抹淺笑 提交于 2019-12-08 08:52:33
问题 I have made an application where users can log in and post text to my Parse database. All posts are held in a text column inside a Posts class, another column in this class is user which is a pointer to my User class which has a column called username, it is the username string that I would like to retrieve. I've managed to query the database and retrieve all of the data within the text column, put it all into a string array and then into a listview in my app. what I would like to achieve

How does a (nonatomic, strong) property's lifespan work in iOS?

孤人 提交于 2019-12-06 09:39:12
问题 Say I have a property declared as : @property (nonatomic, strong) NSArray *menuArr; OR @property (strong) NSArray *menuArr; and set this property in viewDidLoad . How long will the device "remember" the information I have stored in the array? The property is declared and set in a viewController that is embedded in a navigationViewController that is itself the first view controller in a TabBarViewController. In other words its the first view the user sees then they may navigate away from it

PFQueryTableViewController error

巧了我就是萌 提交于 2019-12-06 03:33:35
问题 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

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

北城以北 提交于 2019-12-04 17:51:27
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.parseClassName = @"Recipe"; // The key of the PFObject to display in the label of the default cell style self

How does a (nonatomic, strong) property's lifespan work in iOS?

笑着哭i 提交于 2019-12-04 15:54:29
Say I have a property declared as : @property (nonatomic, strong) NSArray *menuArr; OR @property (strong) NSArray *menuArr; and set this property in viewDidLoad . How long will the device "remember" the information I have stored in the array? The property is declared and set in a viewController that is embedded in a navigationViewController that is itself the first view controller in a TabBarViewController. In other words its the first view the user sees then they may navigate away from it and back. Without getting into a debate over atomic vs nonatomic my question is this Does a property