pfuser

Get PFUser object custom values

一笑奈何 提交于 2020-01-06 13:55:16
问题 I have custom value in a PFUser column called "website" . I am trying to get this value using the code below but it does not seem to change on the device if I update the value from Parse.com on their website using the data viewer. It also does not update across devices. Any Ideas? websiteField.text = currentUser.objectForKey("website") as String 回答1: I have managed to get it working with the code below. var currentUser = PFUser.currentUser() currentUser.refreshInBackgroundWithBlock { (object,

Swift & Parse - PFUser currentUser never equals nil

喜欢而已 提交于 2019-12-31 17:23:44
问题 I am using Xcode, Swift, and Parse. When I try and logout a PFUser, i never get a return of nil. In this part of the app, the viewController is simply showing a few buttons one logs in. One sends the user to signup. One sends the user to change details, and one is a simple logout. The code for the two that matter on logout is; @IBAction func logout(sender: AnyObject) { PFUser.logOut() var currentUser = PFUser.currentUser() self.displayAlert("You are now logged out", error: "") println

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; [

How do I Save an Image PFFile in localdatastore while Offline Parse.com?

本秂侑毒 提交于 2019-12-24 04:17:12
问题 I'm developing an App that use Parse.com Server to Store PFUsers Informations and Classes for each PFUser. I'm able to save everything to the server when i'm online but i would like use the app also when there's no Internet connect which means to save them also when i'm Offline. My App is simple, I have: LoginVC Tableview with all Cars "Cars for Each PFUSER" ViewController "Add a Car" + I Search in Parse.com Docs & i found SaveEventually when we are offline. - (IBAction)save:(id)sender {

PFUser Property on subclassed PFObject

我怕爱的太早我们不能终老 提交于 2019-12-22 11:28:50
问题 I've subclassed the PFObject with the following Class (dynamic properties, and +load & parseClassName Methods in .m file) @interface DAOpponents : PFObject <PFSubclassing> @property (nonatomic, strong) PFObject* fromUser; @property (nonatomic, strong) PFObject* toUser; @property (nonatomic) BOOL isVisible; @property (nonatomic) BOOL isPersistent; + (NSString *)parseClassName; @end In a Unit Test I try to create a Sample DAOpponents-Object: DAOpponents* follow = [DAOpponents object]; follow

Access to [PFUser currentUser] causing deadlock

99封情书 提交于 2019-12-21 12:38:19
问题 Getting a deadlock occasionally when several threads trying to access [PFUser currentUser] when using parse iOS sdk v1.2.20 It looks like whenever I make a PFQuery call or PFCloud function call, these operations also access [PFUser currentUser], so there's increase chance of deadlock if you are making queries from separate threads. Anyone else find a solution for this, I doubt parse even is aware of the problem as they closed these related issues long ago: https://www.parse.com/questions

Major bug in Parse: [PFUser currentUser] deadlocks

烈酒焚心 提交于 2019-12-21 04:26:08
问题 The issue of PFUser deadlocking from thread contention via parse background calls has been raised numerous times by the Parse community, but Parse has chosen not to deal with this giant bug in the framework. Does anyone know of a work around for this issue? Other apparent reports of this issue: https://developers.facebook.com/bugs/649920188390439/ https://www.parse.com/questions/ios-api-apparent-deadlock-in-main-thread-v1213 https://www.parse.com/questions/occasional-freezing-at-pfuser

iOS with Parse. PFUser.currentuser() not getting cached. Returns nil after app restart

倖福魔咒の 提交于 2019-12-21 04:00:16
问题 I am building an app with Parse in swift. PFUser.currentuser() always returns nil after the app is stopped and run again. I am using the iOS simulator and the local datastore is enabled. I am using something like this - if PFUser.currentuser() == nil { // Perform segue to login screen } And for login I am using PFUser.loginWithUsernameInBackground(...) The currentuser remains till the app is restarted, after which it is reset to nil. I have even tried to pin the currentuser but it doesn't

Subclass PFUser in swift

醉酒当歌 提交于 2019-12-19 11:22:50
问题 I wanna subclass the PFUser object in swift. I also want to declare my own variables. The Parse documentation on subclassing do not cover PFUser at this point. Parse documentation on subclassing PFObject: class Armor : PFObject, PFSubclassing { class func load() { self.registerSubclass() } class func parseClassName() -> String! { return "Armor" } } 回答1: BridgingHeader.h: #import <Parse/Parse.h> #import <Parse/PFObject+Subclass.h> User.swift: import Foundation class User : PFUser,

Smart-search for Parse Usernames in Swift not working

久未见 提交于 2019-12-17 06:56:32
问题 I'm trying to have a smart-search in my iOS app so that when a user types a character into a UISearchBar, the results automatically update in the tableview below the searchbar. For some reason, the searchBar function with textDidChange isn't called when I type a character into the search bar. It's called after 2 characters are typed. So my search results are always 1 step behind what's actually typed into the search bar. And it also seems like the search() function is being called twice every