简体   繁体   English

MapKit(Swift 4)Xcode 9.2 - '无法插入第4角的法律归属'

[英]MapKit (Swift 4) Xcode 9.2 - 'Could not inset legal attribution from corner 4'

I'm doing a project that deals with a MapKit. 我正在做一个处理MapKit的项目。 My issue is when I run the app, I get the 'Could not inset legal attribution from corner 4.' 我的问题是,当我运行应用程序时,我得到了“无法在角落4处插入法律归属”。 error. 错误。 What solution can I take to resolve this issue? 我可以采取什么解决方案来解决此问题?

error: 错误:

My app screen: 我的应用屏幕:

I had the exact same error as you - the map was not showing up and I was getting the error: 我有与你完全相同的错误 - 地图没有显示,我收到错误:

2018-08-25 09:59:17.324966-0400 Parse Foursquare Clone[45537:42276733] Could not inset legal attribution from corner 4 2018-08-25 09:59:17.324966-0400 Parse Foursquare Clone [45537:42276733]无法插入角落4的法律归属

2018-08-25 09:59:17.332612-0400 Parse Foursquare Clone[45537:42276733] Could not inset scale from edge 9 2018-08-25 09:59:17.332612-0400 Parse Foursquare Clone [45537:42276733]无法从边缘9插入比例

The reason is because I did not setup the delegates, MKMapViewDelegate and CLLocationManagerDelegate. 原因是因为我没有设置委托,MKMapViewDelegate和CLLocationManagerDelegate。 Here is what I'm looking at in case you're confused. 如果你感到困惑,这就是我正在看的内容。 Once I set these up, the map started appearing. 一旦我设置了这些,地图就开始出现了。 Hope this helps! 希望这可以帮助!

import UIKit
import MapKit
import CoreLocation

class locationVC: UIViewController, MKMapViewDelegate, CLLocationManagerDelegate {

Re-edit the info.plist file. 重新编辑info.plist文件。 Open As -> Source Code To show the XML format of info.plist 打开为 - >源代码显示info.plist的XML格式

Your xCode error message may say the the "NSLocationAlwaysUsageDescription" or "NSLocationAlwaysAndWhenInUseUsageDescription" has problem. 您的xCode错误消息可能会说“NSLocationAlwaysUsageDescription”或“NSLocationAlwaysAndWhenInUseUsageDescription”有问题。

COPY the "NSLocationAlwaysUsageDescription" (or "NSLocationAlwaysAndWhenInUseUsageDescription") in error console and PASTE to the info.plist source file. 将错误控制台和PASTE中的“NSLocationAlwaysUsageDescription”(或“NSLocationAlwaysAndWhenInUseUsageDescription”)复制到info.plist源文件中。

Save the info.plist and run it again. 保存info.plist并再次运行它。

I do it this way and resolved my problem 我这样做,解决了我的问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM