ios - Getting Current Location using Parse SDK -


i'm trying current location of user using build in geopointforcurrentlocation method. try set geopoint in custom field created in user class called location , attempt save using saveinbackground method.

[pfgeopoint geopointforcurrentlocationinbackground: ^(pfgeopoint *geopoint, nserror *error) {     if (!error)     {                         [[pfuser currentuser] setobject: geopoint forkey: @"location"];                         [[pfuser currentuser] saveinbackground];                     }             }]; 

no errors thrown user's location not saved database.

edit:

my viewdidload method looks this:

self.locationmanager = [[cllocationmanager alloc] init]; self.locationmanager.delegate = self;

if ([self.locationmanager     respondstoselector:@selector(requestwheninuseauthorization)]) {     [self.locationmanager requestwheninuseauthorization]; }  

}

and set info.plist key when in use authorization.

did not mark implementation file cllocationmanagerdelegate.


Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

amazon web services - Installing MobileFirst 7.0 server on AWS -

Non Unique Username with ASP.Net Identity 2.0 -