pfobject

iOS Multiple save of parse objects with progress bar

♀尐吖头ヾ 提交于 2020-01-24 06:38:07
问题 I found this very interesting approach (Parse : is it possible to follow progress of PFObject upload) and I tried to convert the objective-c category in a swift extension. But I am overstrained with the values types unsigned long . Please have a look in the following code - it throws the exception (line: let progress:Int32 = Int32(100*count/numberOfCyclesRequired) ): fatal error: floating point value can not be converted to Int32 because it is either infinite or NaN. I am also not sure how to

Image within PFFile will be uploaded to parse instead of being saved into the local datastorage

旧城冷巷雨未停 提交于 2019-12-29 05:37:04
问题 I am using swift with the Parse Framework (1.6.2). I am storing data into the local datastorage. The data consists of a few strings and an image. This image will be stored within a PfFile and then will be added to the PfObject. Now I wondered why the image doesn't get saved until I noticed I needed to call the save() method of the PFFile. Problem is that the Image then seems to be uploaded to Parse which I don't want. I want it to be stored on the local device.. Is there a solution for this?

Adding and initialising a new property for an existing PFObject subclass

扶醉桌前 提交于 2019-12-25 14:12:40
问题 I have an existing Parse database, with several PFObject subclasses. If I want to add a new property to a subclass, an array for example, I add it to the PFObject subclass as an @property and declare it @dynamic in the implementation. I initialise it as empty for new objects. @dynamic newArray; + (instancetype)object { MyObject *myObject = [super object]; myObject.newArray = [NSMutableArray array]; return myObject; } But how can I ensure this is initialised for already existing objects, as

Adding and initialising a new property for an existing PFObject subclass

痞子三分冷 提交于 2019-12-25 14:12:01
问题 I have an existing Parse database, with several PFObject subclasses. If I want to add a new property to a subclass, an array for example, I add it to the PFObject subclass as an @property and declare it @dynamic in the implementation. I initialise it as empty for new objects. @dynamic newArray; + (instancetype)object { MyObject *myObject = [super object]; myObject.newArray = [NSMutableArray array]; return myObject; } But how can I ensure this is initialised for already existing objects, as

Parse iOS SDK, cannot get all fields from _User table

烂漫一生 提交于 2019-12-24 15:02:35
问题 In my application I store information in other fields of the Parse _User table such as a user rank and home City/State. I was able to read all the data from the table for a user simply by running a PFUser query command. PFQuery *userQuery = [PFUser query]; [userQuery whereKey:PARSE_CLASS_USER_USERNAME equalTo:currentUser.username]; [userQuery findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { if (!error) { PFObject *user = [objects firstObject]; _userObject = user; [

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

Which Object's Array Has Most of Particular Object

£可爱£侵袭症+ 提交于 2019-12-12 03:48:06
问题 I have an Object that contains many pieces of information, a Title String, Date String, and NSArray, amongst others. This Object has 8 different sets of this information. I want to find out which Set's Title has the most occurrences of the word "Sunday". After the data loads, I run some calculations: NSArray *yourArrayhere = self.theObject[@"DatesSuggested"]; int occurrences = 0; for(NSString *string in yourArrayhere){ occurrences += ([string isEqualToString:@"Sunday"]?1:0); //certain object

How do you store a dictionary on Parse using swift?

前提是你 提交于 2019-12-12 03:36:25
问题 I am very new to swift and I don't know Obj C at all so many of the resources are hard to understand. Basically I'm trying to populate the dictionary with PFUsers from my query and then set PFUser["friends"] to this dictionary. Simply put I want a friends list in my PFUser class, where each friend is a PFUser and a string. Thanks! var user = PFUser() var friendsPFUser:[PFUser] = [] var friendListDict: [PFUser:String] = Dictionary() var query = PFUser.query() query!

Implementing a like button

非 Y 不嫁゛ 提交于 2019-12-11 12:27:55
问题 I'm having trouble implementing a working like button in a table cell, using Parse as the backend. There is a button in the tablecell, which is called using a sender/tag. Here's the code. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"FeedCell"; FeedCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[FeedCell alloc] initWithStyle

iOS Parse PFObject Subclassing with Swift Behaviour

时光怂恿深爱的人放手 提交于 2019-12-04 06:30:13
问题 I have a strange issue, my subclassing works in all my view controllers except one. I have imported everything that is required, but this one class is giving me the "Missing argument for parameter 'className' in call" My subclass import Foundation import Parse class Session : PFObject, PFSubclassing { class func parseClassName() -> String { return "Session" } } // i have removed the non important info I perform the Session.registerSubclass() In the app delegate In EVERY class I have i can