File tree 1 file changed +12
-6
lines changed
runtimes/cpp/platforms/iphone/Classes/Location
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 29
29
return sLocationController ;
30
30
}
31
31
32
+ // TODO Redo this so that it returns true availability
33
+ // (depending on the users accept of sharing locaation).
32
34
int maLocationStart ()
33
35
{
34
- MoSyncCLController* locationController = getLocationController ();
35
- [locationController.locationManager startUpdatingLocation ];
36
+ [[NSOperationQueue mainQueue ] addOperationWithBlock: ^ {
37
+ MoSyncCLController* locationController = getLocationController ();
38
+ [locationController.locationManager startUpdatingLocation ];
39
+ }];
36
40
return MA_LPS_AVAILABLE;
37
41
}
38
42
39
43
int maLocationStop ()
40
44
{
41
- MoSyncCLController* locationController = getLocationController ();
42
- [locationController.locationManager stopUpdatingLocation ];
45
+ [[NSOperationQueue mainQueue ] addOperationWithBlock: ^ {
46
+ MoSyncCLController* locationController = getLocationController ();
47
+ [locationController.locationManager stopUpdatingLocation ];
48
+ }];
43
49
return 0 ;
44
50
}
45
51
@@ -50,8 +56,8 @@ @implementation MoSyncCLController
50
56
- (id ) init {
51
57
self = [super init ];
52
58
if (self != nil ) {
53
- self.locationManager = [[[CLLocationManager alloc ] init ] autorelease ];
54
- self.locationManager . delegate = self; // send loc updates to myself
59
+ self.locationManager = [[[CLLocationManager alloc ] init ] autorelease ];
60
+ [ self .locationManager setDelegate: self ];
55
61
}
56
62
return self;
57
63
}
You can’t perform that action at this time.
0 commit comments