2013-01-21 125 views
-2

我開始使用GPS,然後保持開啓狀態,並使用openUrl在應用程序內撥打電話,然後再次返回到應用程序並嘗試通過撥打stopUpatingLocation來停止該GPS,但GPS並未停止。locationmanger不會停止

請給一些解決方案來停止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]; 

感謝來電掛斷

+1

請添加相關代碼,我們不禁無需提供任何關於您的代碼的信息 –

+0

您能告訴我們您的代碼嗎? – Raptor

+0

app.locationManager.delegate = app; [app.locationManager startMonitoringSignificantLocationChanges]; [app.locationManager startUpdatingLocation]; //啓動gps然後使用代碼調用hangup [[UIApplication sharedApplication] tel:@「number」]; – user1258592

回答

1

我想,很快讓外景經理釋放object.also使它是一個零。

例如::

[locationManager release]; 
locationManager=nil; 

寫在你的dealloc這兩條線。 希望它有幫助