草庐IT

col_location

全部标签

iOS 7 核心位置 : region monitoring fails on the first time after location services are authorised

我使用CoreLocation在我的应用程序上发现了一个奇怪的行为。我正在使用区域监控功能,但在授权位置服务(通过弹出窗口或设置->位置服务)后,区域监控失败(操作无法完成。kCLErrorDomain错误5.)。如果我关闭应用程序并重新启动(因此已经获得授权),一切都会按预期进行。我的代码如下所示:-(void)initializeLocationServices{NSLog(@"Startedlocationservices");locationManager=[[CLLocationManageralloc]init];locationManager.delegate=self;

iphone - 从代码打开 map 应用程序 - 在哪里/如何找到 "Current Location"?

我正在打开map应用程序以显示从用户当前位置到目的地坐标的路线,这些路线来self的代码。我正在使用以下代码打开map应用程序。我在按下按钮时调用此代码。getCurrentLocation是一种返回最近更新位置的方法。-(void)showDirectionsToHere{CLLocationCoordinate2DcurrentLocation=[selfgetCurrentLocation];//LINE1NSString*url=[NSStringstringWithFormat:@"http://maps.google.com/maps?saddr=%f,%f&daddr=%

ios - 从 URLSession 返回的位置没有数据( session :downloadTask:didFinishDownloadingToURL location)

我正在使用标准后台session来处理后台提取。操作开始正常并回调:URLSession(session:downloadTask:didFinishDownloadingToURLlocation)被定期调用,但是当我检查位置url的内容时,我发现没有。我检查了正在处理的url,它是好的,当在浏览器上提交时正确返回数据。可能是什么?我知道我需要复制数据,因为它在临时缓存中,但当它应该还在时我立即检查了它的内容。这是我的代码:letspan:Float=0.005funchandleRemoteFetch(completionHandler:((UIBackgroundFetchRes

ios - 无法在 info.plist 中添加 "Privacy - Location Always and When in use usage description"- Xcode 9 Beta

在Xcode9Beta中尝试向用户请求位置许可时出现以下错误。我尝试在info.plist中添加"Privacy-LocationWhenInUseUsageDescription"和"Privacy-LocationUsageDescription"描述,但仍然出现相同的错误。Thisapphasattemptedtoaccessprivacy-sensitivedatawithoutausagedescription.Theapp'sInfo.plistmustcontainbothNSLocationAlwaysAndWhenInUseUsageDescriptionandNSL

ios - PHAsset Location -- GPS MetaData,怎么了?

尝试使用Phasset从UIImage添加位置://imageisavariablelikeso:image:UIImagevarnewAsset=PHAssetChangeRequest.creationRequestForAssetFromImage(image)newAsset.location=CLLocation(latitude:coordinate.latitude,coordinate.longitude)此代码显然有效->将具有良好坐标的新Assets保存到照片库中。我可以在图书馆本身看到它。但是当我使用exif工具和类似工具时,大多数时候,GPS字典是空的,就好像没

ios - UISupportedExternalAccessoryProtocols 的蓝牙协议(protocol)名称

我正在使用iOS9和Swift2构建一个应用程序,当iPhone与汽车的蓝牙连接/断开连接时,该应用程序会收到通知。我正在使用EAAccessoryManager.sharedAccessoryManager().connectedAccessories获取已连接配件的列表。我在Info.plist中添加了UISupportedExternalAccessoryProtocols,但我不知道要添加什么协议(protocol)。有人可以在我可以获得这些协议(protocol)名称的方向上轻推我吗?我希望协议(protocol)名称是通用的,以便它们适用于任何汽车中的蓝牙设备。当我运行该应

ios - CoreData 的 XCTestCase 失败,返回 "could not locate the entity for myappTests.Example"

我可以在XCTestCase测试中创建这样的实体:letentity=NSEntityDescription.insertNewObject(forEntityName:String(describing:Example.self),into:inMemoryManagedObjectContext)但是如果我这样做的话:letitem=Example(context:inMemoryManagedObjectContext)测试会失败并显示...failed:caught"NSInvalidArgumentException","AnNSManagedObjectofclass'my

java - "Location is required"加载FXML文件时出现异常

我正在尝试加载FXML文件并将其显示为应用程序窗口,但出现异常。FXML文件由FXMLSceneBuilder创建。这是类的代码publicclassMainextendsApplication{publicstaticvoidmain(String[]args){launch(args);}@Overridepublicvoidstart(StageprimaryStage)throwsException{primaryStage.setScene(FXMLLoader.load(getClass().getResource("sample.fxml")));primaryStage

java - React Native - java.lang.RuntimeException : SDK location not found. 在 local.properties 中使用 sdk.dir 定义位置

开始使用ReactNative。我确实安装了AndroidSDK、JavaSDK和Android依赖项。在我的终端上运行演示应用程序时,我收到以下错误。我的Galaxy模拟器正在运行:~emulator@galaxyHAXMisworkingandemulatorrunsinfastvirtmodeemulator:UpdateChecker:skippedversioncheck现在我运行它:~react-nativerun-androidStartingJSserver...Buildingandinstallingtheapponthedevice(cdandroid&&./gr

android - 如果我已经有 ACCESS_FINE_LOCATION,我可以省略 ACCESS_COARSE_LOCATION 吗?

我有一个GPS应用程序已经在list中请求ACCESS_FINE_LOCATION权限,现在我想添加一个需要ACCESS_COARSE_LOCATION的库(MoPub)。我是否正确假设ACCESS_FINE_LOCATION就足够了,我可以从list中省略ACCESS_COARSE_LOCATION吗? 最佳答案 https://developer.android.com/guide/topics/location/strategies.html#PermissionNote:IfyouareusingbothNETWORK_PR