-2

私はGPSを開始し、それをオンにしてアプリケーション内で電話をかけ、openUrl再びアプリケーションに戻って電話でそのGPSを停止しようとしましたstopUpatingLocationが、GPSは停止しませんでした。

GPSを停止する解決策を教えてください。

コード

 app.locationManager.delegate=app;
 [app.locationManager startMonitoringSignificantLocationChanges];
 [app.locationManager startUpdatingLocation]; //start gps              

次に、コードを使用してハングアップを呼び出します [[UIApplication sharedApplication] tel:@"number"];

**Now after call hangup i need to stop that gps .... i have already written code below** 

[app.locationManager stopMonitoringSignificantLocationChanges];
[app.locationManager stopUpdatingLocation];
app.locationManager=nil;
[app.locationManager release];

前もって感謝します

4

1 に答える 1

1

ロケーションマネージャーオブジェクトのリリースを作成するだけだと思います。また、それをnilにします。

例::

[locationManager release];
locationManager=nil;

これらの2行をdeallocに書き込みます。それが役に立てば幸い

于 2013-01-21T06:56:07.210 に答える