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

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -