草庐IT

Location1

全部标签

ios - Swift 3 核心数据 - 实体(上下文 :) vs Entity(entity: Location. 实体(),insertInto:上下文)

我观看了关于CoreData的2016WWDC视频并查看了各种教程。我见过使用CoreDataFramework创建对象以持久保存到managedObjectContext中的各种方法。在示例中,我将Day作为一个实体。我想为用户使用应用程序的每一天创建一个新的Day对象。我遇到过:第一个选项letentity=NSEntityDescription.insertNewObject(forEntityName:"Day",into:CoreDataHelper.context)letobject=NSManagedObject(entity:entity,insertInto:Core

ios - 使用 Core Location 的 Swift 后台获取位置更新

我想在我的应用程序上使用后台获取位置更新服务。但是不要在这里显示我的代码的任何输出我需要你的帮助。importCoreLocationclassViewController:UIViewController,UITextFieldDelegate,CLLocationManagerDelegate{varlocationManager:CLLocationManager=CLLocationManager()overridefuncviewDidLoad(){super.viewDidLoad()self.locationManager.delegate=selflocationMan

ios - 如何将纬度和经度传递给另一个函数 - swift location

我在将纬度和经度传递给一个函数时遇到问题,我正在构建apiurl以获取一些天气数据。我知道在调用天气函数之前我缺少调用位置函数的东西。基本上我的想法是先获取位置并将纬度和经度存储在一些变量中,然后调用我在其中使用这些值的天气函数。我已经为我的思路提供了评论。如有任何帮助,我们将不胜感激。谢谢你。importUIKitimportCoreLocationclassViewController:UIViewController,CLLocationManagerDelegate{varlocManager=CLLocationManager()//createdthesetostoreth

swift - iOS swift 3 : Location Privacy Denied

如果应用的位置隐私访问被拒绝怎么办?大家好,我正在编写一个简单的应用程序,它在使用时使用位置。设计模式首先,当您启动应用程序时,它会检查是否已设置权限。如果没有,它会显示一个请求许可的警报。如果是并获得批准,它将继续执行其工作。如果是但被拒绝,它会显示一条警报,要求通过指向设置的按钮授予访问权限。应该可以从设置返回到应用程序。应用程序发挥作用。如果用户在应用程序仍处于打开状态时更改隐私设置,则应通知该应用程序,并重复第1步。到目前为止的代码主Controllerletmanager=LocationManager()overridefuncviewDidLoad(){super.vie

ios - swift ios9 : Trying to start MapKit location updates without prompting for location authorization

我为mapViewsuingswift写了一个简单的例子,但我得到打印TryingtostartMapKitlocationupdateswithoutpromptingforlocationauthorization.必须先调用-[CLLocationManagerrequestWhenInUseAuthorization]或-[CLLocationManagerrequestAlwaysAuthorization]。我将mapView添加到viewController并开始定位。我还在startUpdatingLocation()之前调用了requestWhenInUseAutho

ios - 安装 Swift 开源 Xcode 工具链时出错 : You cannot install Swift Open Source Xcode Toolchain in this location

我刚刚按照描述下载了Swift开源Xcode工具链here.然而,当按照安装说明进行操作时,第二条说明已经失败,它说:Runthepackageinstaller,whichwillinstallanXcodetoolchaininto/Library/Developer/Toolchains/.AnXcodetoolchain(.xctoolchain)includesacopyofthecompiler,lldb,andotherrelatedtoolsneededtoprovideacohesivedevelopmentexperienceforworkinginaspecifi

swift - 错误 : 'Delegate must respond to locationManager:didUpdateLocations:' when collecting user location

所以我想在用户点击按钮时收集用户位置,并稍后在我的应用程序中使用该位置。在我当前的实现中,当点击按钮时,应该提示用户允许共享位置,然后他们应该登录到应用程序(如果你想知道的话,通过Firebase匿名登录),并且应该打印用户位置信息到控制台。提示有效,但是在点击允许位置按钮后,我的应用程序终止duetouncaughtexception'NSInternalInconsistencyException'原因是'DelegatemustrespondtolocationManager:didUpdateLocations:'这很奇怪,因为我的代码中确实有一个didUpdateLocati

Vue路由导航报错:NavigationDuplicated: Avoided redundant navigation to current location解决方法

点击vue路由跳转,控制台报错:Avoidedredundantnavigationtocurrentlocation:“/xxxxxx“解决方法一、描述问题在使用this.$router.push跳转页面时候,重复点击菜单引起路由重复报错比如当前页面显示区是路由组件‘/cats’,重复点击按钮进行this.$router.push跳转,要跳转的组件仍然是‘/cats’,那么控制就会报如下错误:二、报错原因由于vue-router3.0及以上版本回调形式改成PromiseAPI的形式了,返回的是一个Promise。也是说push和replace都是Promise类型了。而Promise的回调函

selenium.common.exceptions.SessionNotCreatedException: Message: Expected browser binary location…

问题描述:selenium启动firefox浏览器驱动时报错“selenium.common.exceptions.SessionNotCreatedException:Message:Expectedbrowserbinarylocation…”问题截图:问题原因:可能原因,需逐一排查:1、系统未安装FireFox浏览器(已安装)2、驱动和浏览器版本不匹配(驱动和浏览器都是最新的)3、Firefox没有安装在你系统中的默认位置(装在d盘了)解决方案:原因1的解决方案:安装FireFox浏览器原因2的解决方案:安装和浏览器匹配的浏览器驱动原因3的解决方案一:在环境变量path中添加firfox

java - 在空对象引用上调用虚拟方法 'double android.location.Location.getLatitude()' 时出错

我想要做的就是让用户获得他喜欢的类型的位置列表。例如,如果输入是医院,我的应用程序将使用搜索字符串“医院”打开谷歌地图。但正如文档中所建议的那样,使用像geo:0,0?q=hospital这样的地理编码uri显示坐标0纬度和0经度附近的所有医院。因此,当我尝试使用以下代码首先获取用户坐标时。PlacesDecoder.javapackagecom.kkze.Mappy;importandroid.app.Activity;importandroid.app.AlertDialog;importandroid.content.Context;importandroid.content.D