Xcode Beta 6 - Use of undeclared type 'CLLocationManagerDelegate'
Asked Answered
M

3

7

I have just upgraded from Xcode 6 Beta 3 to Xcode 6 Beta 6. In Beta 3, everything worked fine and compiled like I wanted it to.

Right now, I cannot get CLLocationManagerDelegate to work, i.e. I always get the Use of undeclared type 'CLLocationManagerDelegate' - error message.

This is what my file looks like:

import UIKit
import CoreLocation

class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, CLLocationManagerDelegate {

Additional info:

  • I have added the CoreLocation Framework (tried adding it within Xcode directly, also by drag-and-dropping the actual file from the folder, no changes)
  • I have had to reinstall Xcode 6 Beta 6 a couple of times before getting it to start (running OSX 10.9.4, always crashed on first startup)
  • As you can see, I import CoreLocation to my file.
  • CLLocationManagerDelegate does not autocomplete, it goes as far as CLLocationManager

Any ideas? I'm assuming something is not linked properly here.

Molt answered 30/8, 2014 at 11:33 Comment(2)
Have you cleaned the project, deleted all derived data, ... ?Bertold
yes, i have tried that multiple timesMolt
W
4

Try to clean your build directory:

Product-->Clean

Product-->(Alt key) Clean Build Folder

Delete your derived data:

Window-->Organizer-->delete derived data

Withdraw answered 30/8, 2014 at 11:49 Comment(4)
I did in fact try all of these steps multiples times, the error is still the same.Molt
What happens if you cmd-Click on "CoreLocation"? It should open the definition file. Another thought: Did you include the CoreLocationFramework to your project?Withdraw
It opens up. "import CoreLocation.CLLocationManagerDelegate" statement is in there. When I cmd-Click CLLocationManagerDelegate, or any other files that are imported (in the ViewController, as well as the definition file) I get "Symbol not found" error.Molt
Also, if I create a new project, everything just works fine in terms of CLLocationManagerDelegate.Molt
R
4

Another possible reason for the 'use of undeclared type' error is that your class is also within your test target, but the 'undeclared type' is not.

Raji answered 5/12, 2014 at 8:49 Comment(0)
M
2

This was a bug in XCode. Was solved in Beta7/Xcode6.

Molt answered 14/9, 2014 at 14:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.