问题标签 [cllocation]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
iphone - 将 CLLocation 位置点保存到数组中会给我带来内存/性能问题
我在使用 iPhone GPS 'runkeeper' 类型的应用程序时遇到了一点问题。该应用程序几乎在所有方面都可以正常工作,我设计它的方式是将 CLLocation 对象添加到数组中,然后将该对象数组存储在 MySQL 数据库中。然后,当我打开一个地图视图时,我只需从服务器中拉出数组,并通过一些操作,使用数据将图钉添加到地图中。
就像我说的那样,这一切都运行良好,坐在我的办公桌前时,在模拟器和设备上运行良好(顺便说一句,使用仪器 - 没有泄漏)。但是,当我在设备上测试了应用程序并实际离开房子并在街上走了 15 分钟时,应用程序在 CLLocationManager 对象停止更新并且数组已发布到 MySQL 时崩溃 - 几乎可以肯定(我认为)因为内存问题。
既然如此,鉴于我是一个相对的菜鸟,所以要温柔,我正在寻找有关开发一种更有效的方法将对象存储到数组中的建议,以便可能大量存储的位置数据不会' t 融化应用程序。
这是我正在使用的代码的(选择):
//注意我已经取出了确定CLocation对象是否有效的代码,还有一两个其他的小东西
iphone - 如何在 MapKit 的稍后屏幕中获取用户的位置?
我正在为 iPhone 构建一个基于导航的应用程序,在其中计算用户在 RootViewController 中的地理位置(这是我的 RootViewController.h 的代码)类:
这是我的 RootViewController.m 类的代码:
因为我在 RootViewController 类中计算用户的地理位置,所以当我稍后在 MapViewController.m 类的应用程序中使用 MapKit 时,我想重新使用这些值:
我希望地图以用户位置为中心,并选择适当的跨度值。
iphone - 显示指向特定位置的箭头
有谁知道如何根据我当前的标题放置一个指向特定注释的箭头。例如; 当当前标题与注释的坐标相同时,我希望箭头是垂直的。我通过贝宝向为我做这件事的人提供 50 美元 看看下面的图片;
.
iphone - 应用程序在后台时运行 CLLocation
如何在后台保持 CLLocation 更新。我相信您需要在 Application 委托中注册应用程序才能执行此操作,但我在任何地方都找不到对此的引用?
iphone - 如何判断您是否在 iPhone 应用程序中面临特定的 CLLocation
所以我正在制作一个增强现实应用程序,但我有点不确定如何判断,鉴于您当前的位置和航向信息以及第二个位置,如果您真的面对那个位置。我认为这与 CLLocation 标题的特定部分有关,但我有点不确定。任何帮助都会很棒,非常感谢大家
iphone - 核心位置区域监控
有谁知道使用这个的任何知识:
- (void) startMonitoringForRegion:(CLRegion *)region desiredAccuracy:(CLLocationAccuracy)accuracy
我正在尝试将其实施到我的项目中,但是:
- (void) locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region
是从来没有被调用过吗?
有没有人有任何示例代码或知道为什么会这样?
我的代码如下。我在自己的 LocationManager 类中创建了这样的方法:
然后我这样称呼它:
我得到 NSLog 的:
2011-01-30 19:52:26.409 测试位置[10858:307] 开始监控
2011-01-30 19:52:27.103 测试位置[10858:307] 监控区域:
但永远不要从以下位置获取 NSLog:
或者
谢谢
iphone - MKMapKit 两个注释之间的真实距离
我想制作一个应用程序来计算用户当前位置和最近的东西(商店,诸如此类)之间的距离。有没有办法获得实际距离(沿着公共道路)而不是直接距离(从 A 点到 B 点的线)?
谢谢
iphone - ALAssetPropertyLocation not working on any iOS 4.0+ on 3gs iPhones but working perfectly on iPhone4
I've got an app with location services ENABLED (from settings etc), and I'm reading all the photos from my device using ALAssetsLibrary.
It works perfectly on iPhone4 iOS 4.2.1, but the same code and the same assets DONT WORK on any 3gs any iOS (from 4.0 to 4.2.1).
The problem is that it retrieves always an invalid CLLocation on the 3gs.
Even on the same picture (copied across both devices) on the iPhone4 returns a valid CLLocation, on the 3gs it returns invalid! The picture image itself it's valid on both devices, only the CLLocation is invalid. I dont have any crashes and the code doesnt step into any invalid blocks, it all works fine apart from the invalid CLLocation data.
Output of the same asset and same code and same iOS version (4.2.1):
iPhone4: <+51.23816667, -0.57700000> +/- 0.00m (speed -1.00 mps / course -1.00) @ 19/02/2011 01:59:28 Greenwich Mean Time
3gs: < nan, nan > +/- 0.00m (speed -1.00 mps / course -1.00) @ 2011-02-19 01:20:35 +0000
(Note also the date on the invalid location is the current time)
Im getting the CLLocation like this:
The ALAssetsLibrary code called in my viewcontroller DidLoad looks like this (totally standard):
One last thing, on the native photo app the pictures are shown in the correct location on the 3gs, so they must have that data somewhere, it just doesnt read it somehow!
I'm not entirely sure it's a device (3gs) problem, normally it never is...
iphone - CLLocation 标头始终为 -1
嘿伙计们,我正在尝试构建一个应用程序,该应用程序将使用指南针指向预定位置的方向,但现在我正在尝试了解如何制作基本指南针。我遵循了一个指南,但是我总是得到“-1”作为标题,并且只让它工作了一次,从那以后我就没有更改过代码。任何想法都会有所帮助。
和实现文件...
iphone - 在 userdefaults iphone sdk 中存储 cllocation 值数组
嗨,我有一个 cllocation 值数组,我需要将该数组存储在 userdefaults 中...我该怎么做...?
您好,我在数组中添加对象:[AM_locationMP.favArray addObject:[AM_locationMP.locationData objectAtIndex:AM_locationMP.indexno]];
其中位置数据是位置地标值的数组。
其中 maplocationVO 类用于地标 MapLocationVO *currentMapLocation;
[AM_delegate.locationData addObject: currentMapLocation];