Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xcode 核心位置似乎未被识别_Xcode_Cocoapods - Fatal编程技术网

Xcode 核心位置似乎未被识别

Xcode 核心位置似乎未被识别,xcode,cocoapods,Xcode,Cocoapods,我最近在xcode中安装了cocoa pods,并在适当的文件中启动了我的项目。我在udemy上学习swift,我们的部分任务是使用库CoreLocation创建天气应用程序。问题是,xcode似乎无法识别该库。当我按住命令并单击“查找定义”时,会弹出一个问号。在我观看的udemy视频中,我的讲师可以轻松地阅读库的定义。这可能是椰子荚的问题吗?我确信我写的是正确的,因为我在逐字逐句地看视频 import UIKit import Corelocation class WeatherView

我最近在xcode中安装了cocoa pods,并在适当的文件中启动了我的项目。我在udemy上学习swift,我们的部分任务是使用库CoreLocation创建天气应用程序。问题是,xcode似乎无法识别该库。当我按住命令并单击“查找定义”时,会弹出一个问号。在我观看的udemy视频中,我的讲师可以轻松地阅读库的定义。这可能是椰子荚的问题吗?我确信我写的是正确的,因为我在逐字逐句地看视频

import UIKit

import Corelocation


class WeatherViewController: UIViewController, CLLocationManagerDelegate {

    //Constants
    let WEATHER_URL = "http://api.openweathermap.org/data/2.5/weather"
    let APP_ID = "e72ca729af228beabd5d20e3b7749713"


    //TODO: Declare instance variables here
    let locationManager = CLLocationManager()



    //Pre-linked IBOutlets
    @IBOutlet weak var weatherIcon: UIImageView!
    @IBOutlet weak var cityLabel: UILabel!
    @IBOutlet weak var temperatureLabel: UILabel!


    override func viewDidLoad() {
        super.viewDidLoad()
        locationManager.Delegate = self

CoreLocation是一个Apple框架,因此请确保:

import CoreLocation
在类定义上方,您希望在其中使用此框架的部分

希望有帮助