2 starwar2012 starwar2012 于 2013.04.10 15:02 提问

startMonitoring在ios5不运行

初始化location Manager:

self.locationManager = [[[CLLocationManager alloc] init] autorelease];
self.locationManager.delegate = self;
[self.locationManager startMonitoringSignificantLocationChanges];

在ios6中,创建之后,当前的location就会调用delegates

- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations

但是在ios5中测试的时候,delegates就没有被调用。
为什么?

谢谢

1个回答

prettYYoyic
prettYYoyic   2013.04.10 17:23
已采纳

问题是方法:

- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations

是iOS6新的, 在iOS5中需要使用:

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocatio
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐
AFNetworking实时监视网络状况AFNetworkReachabilityManager
#pragma mark - 网络状态的实时检测; - (BOOL)isNetWorkReachable{ __block CGRect rect = _nonNetworkLabel.frame; AFNetworkReachabilityManager *afNetworkReachabilityManager = [AFNetworkReachabilit
Apple iBeacons
iBeacons是Apple在iOS 7里加入的新特性,
IOS6区别于IOS5的几个不明显的改变
除了显而易见的状态栏变色,几个系统自带图标的美化(比如“设置”图标),白色风格的拨号键盘,能最大化的浏览器,勿扰模式,可自定义的震动,可随意摆放的虚拟HOME键,中文siri等等外,以下是另外一些IOS6不明显的改变:  1. 点亮屏幕的瞬间,亮度是逐渐恢复的,而不是像IOS5那样一瞬间就到设定值。 这点很赞,夜间能保护眼睛。  2. 长按文字内容后,放大镜的样式改变了。  3.
解决 iOS 5.1.1 完美越狱后安装破解软件提示“认证失败,授权无效”的问题
iOS 5.1.1 的完美越狱出来之后,马上就越了,但是在用 iTools 安装一些和谐版的软件时,总是会提示 “认证失败,授权无效” 而导致无法安装。   晚上查了一下,原来是还需要安装个 Cydia 插件,叫做“appsync 5.0+” Cydia 源地址是:http://cydia.hackulo.us/   不过,我比较好奇的是,以前 433 和 501 完美越狱的时候我都
IOS 5基础教程中文版 高清完整PDF+源码
适合有志于学习IOS开发的初学者,文档内容清晰,浅显易懂,另有源码例程,绝对是初学者的不二之选。
红雪0.9.9b7_摇摆哥汉化版
IOS5越狱专用,,,不完美越狱,汉化版本,放心使用
iphone4 红雪0.9.9b5 mac 版本
iphone4 ios5 不完美越狱最新mac 版本
iOS基础知识5
一、objc使用什么机制管理对象内存? 通过retainCount的机制来决定对象是否需要释放。每次RunLoop的时候,都会检查对象的retainCount,如果retainCount 为0,说明该对象没有地方需要继续使用了,可以释放掉。 二、ARC通过什么方式帮助开发者管理内存? ARC相对于MRC,不是在编译时添加retain、release、autorel
百度贴吧 IOS4.3 IOS5 可用版本
适合TOUCH3 TOUCH4 IPAD1 IPHONE3GS 老系统使用
a20_hummingbird_v4.5_v1.0_csi01_2ov7670_rtl8188eus 20150918 1830 JNI.7z
a20_hummingbird_v4.5_v1.0_csi01_2ov7670_rtl8188eus 20150918 1830 JNI.7z 无法打开USB Wifi rtl8188eus.txt 配置前后ov7670双摄像头 JNI调用读写一次之后就会出现内核出错,系统死机。 有可能与系统为android4.4有关。 无法打开USB Wifi rtl8188eus shell@wing-k70:/ $ shell@wing-k70:/ $ shell@wing-k70:/ $ shell@wing-k70:/ $ logcat -c shell@wing-k70:/ $ logcat --------- beginning of /dev/log/system I/ActivityManager( 1670): Waited long enough for: ServiceRecord{41e90e08 u0 com.android.calendar/.alerts.InitAlarmsService} --------- beginning of /dev/log/main D/dalvikvm( 1849): GC_FOR_ALLOC freed 673K, 22% free 5143K/6512K, paused 41ms, total 47ms I/ActivityManager( 1670): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.settings/.Settings} from pid 1849 D/PermissionCache( 1252): checking android.permission.READ_FRAME_BUFFER for uid=1000 => granted (3161 us) D/BluetoothAdapter( 1931): 1103979928: getState() : mService = null. Returning STATE_OFF D/libEGL ( 1931): loaded /system/lib/egl/libEGL_mali.so D/libEGL ( 1931): loaded /system/lib/egl/libGLESv1_CM_mali.so D/libEGL ( 1931): loaded /system/lib/egl/libGLESv2_mali.so D/OpenGLRenderer( 1931): Enabling debug mode 0 D/BluetoothAdapter( 1931): 1103979928: getState() : mService = null. Returning STATE_OFF I/ActivityManager( 1670): Displayed com.android.settings/.Settings: +1s78ms D/WifiService( 1670): setWifiEnabled: true pid=1931, uid=1000 D/WifiHW ( 1670): Start to insmod 8188eu.ko [ 54.805792] ****wyb arch/arm/mach-sun7i/rf/wifi_pm.c:69/wifi_pm_power()! on=1 [ 54.813855] ****wyb arch/arm/mach-sun7i/rf/wifi_pm.c:73/wifi_pm_power()! [ 54.821376] ****wyb arch/arm/mach-sun7i/rf/wifi_pm_rtl8188eu.c:197/rtl8188eu_power()! mode=1 *updown=1 [ 54.831805] ****wyb arch/arm/mach-sun7i/rf/wifi_pm_rtl8188eu.c:95/rtl8188eu_gpio_ctrl()! name=rtk_rtl8188eu_wl_dis, level=1 [ 54.844290] ****wyb arch/arm/mach-sun7i/rf/wifi_pm_rtl8188eu.c:209/rtl8188eu_power()! usb wifi power state: on [ 54.855621] ----wyb arch/arm/mach-sun7i/rf/wifi_pm_rtl8188eu.c:222/rtl8188eu_power()! D/WifiHW ( 1670): faied to read proc/net/wireless D/WifiHW ( 1670): loading wifi driver... D/WifiHW ( 1670): faied to read proc/net/wireless D/WifiHW ( 1670): loading wifi driver... I/USB3G ( 1258): event { 'add', '/devices/platform/sw-ehci.2/usb4/4-1', 'usb', '', 189, 385 } I/USB3G ( 1258): path : '/sys/devices/platform/sw-ehci.2/usb4/4-1' I/USB3G ( 1258): VID :size 5,vid_path '/sys/devices/platform/sw-ehci.2/usb4/4-1/idVendor',VID '0bda I/USB3G ( 1258): '. I/USB3G ( 1258): PID :size 5,Pid_path '/sys/devices/platform/sw-ehci.2/usb4/4-1/idProduct',PID '8179 I/USB3G ( 1258): '. I/USB3G ( 1258): cmd=source /system/xbin/usb_modeswitch.sh /system/etc/usb_modeswitch.d/0bda_8179 &, D/WifiHW ( 1670): faied to read proc/net/wireless D/WifiHW ( 1670): loading wifi driver... I/USB3G ( 1258): excute ret:0,err:No such file or directory I/USB3G ( 1258): free cmd W/ContextImpl( 1670): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1123 com.android.server.usb.UsbSettingsManager.deviceAttached:621 com.android.server.usb.UsbHostManager.usbDeviceAdded:156 com.android.server.usb.UsbHostManager.monitorUsbHostBus:-2 com.android.server.usb.UsbHostManager.access$000:38 D/Tethering( 1670): sendTetherStateChangedBroadcast 1, 0, 0 W/SocketClient( 1249): write error (Broken pipe) D/Tethering( 1670): InitialState.processMessage what=4 D/Tethering( 1670): sendTetherStateChangedBroadcast 0, 0, 0 D/WifiHW ( 1670): faied to read proc/net/wireless D/WifiHW ( 1670): loading wifi driver... D/WifiHW ( 1249): Enter: wifi_get_fw_path function, fw_type=0, D/WifiHW ( 1249): Eneter: wifi_change_fw_path, fwpath = STA. D/SoftapController( 1249): Softap fwReload - Ok D/CommandListener( 1249): Setting iface cfg D/CommandListener( 1249): Trying to bring down wlan0 D/WifiMonitor( 1670): startMonitoring(wlan0) with mConnected = false I/wpa_supplicant( 2247): Successfully initialized wpa_supplicant I/wpa_supplicant( 2247): rfkill: Cannot open RFKILL control device D/BluetoothAdapter( 1931): 1103979928: getState() : mService = null. Returning STATE_OFF I/wpa_supplicant( 2247): rfkill: Cannot open RFKILL control device D/WifiConfigStore( 1670): Loading config and enabling all networks E/WifiConfigStore( 1670): Error parsing configurationjava.io.FileNotFoundException: /data/misc/wifi/ipconfig.txt: open failed: ENOENT (No such file or directory) D/BluetoothAdapter( 1931): 1103979928: getState() : mService = null. Returning STATE_OFF E/WifiStateMachine( 1670): Failed to set device name wing_k70 E/WifiStateMachine( 1670): Failed to set manufacturer Allwinner E/WifiStateMachine( 1670): Failed to set model name AOSP on wing E/WifiStateMachine( 1670): Failed to set model number AOSP on wing E/WifiStateMachine( 1670): Failed to set serial number 582034060190a829459 E/WifiStateMachine( 1670): Failed to set WPS config methods E/WifiStateMachine( 1670): Failed to set primary device type 10-0050F204-5 D/CommandListener( 1249): Setting iface cfg D/CommandListener( 1249): Trying to bring up p2p0 D/WifiMonitor( 1670): startMonitoring(p2p0) with mConnected = true E/WifiStateMachine( 1670): Failed to set frequency band 0 [ 57.384990] init: untracked pid 2221 exited D/InitAlarmsService( 2053): Clearing and rescheduling alarms. W/SocketClient( 1249): write error (Broken pipe) D/ConnectivityService( 1670): Sampling interval elapsed, updating statistics .. D/ConnectivityService( 1670): Done. D/ConnectivityService( 1670): Setting timer for 720seconds I/MediaFocusControl( 1670): AudioFocus abandonAudioFocus() from android.media.AudioManager@41cc7828com.android.music.MediaPlaybackService$3@41cc66a8 I/ActivityManager( 1670): Start proc com.android.musicfx for broadcast com.android.musicfx/.ControlPanelReceiver: pid=2265 uid=10008 gids={50008, 3003, 3002} V/MusicFXControlPanelReceiver( 2265): onReceive V/MusicFXControlPanelReceiver( 2265): Action: android.media.action.CLOSE_AUDIO_EFFECT_CONTROL_SESSION V/MusicFXControlPanelReceiver( 2265): Package name: com.android.music V/MusicFXControlPanelReceiver( 2265): Audio session: 8 V/MusicFXControlPanelEffect( 2265): closeSession(android.app.ReceiverRestrictedContext@41ccc508, com.android.music, 8) ^C 130|shell@wing-k70:/ $