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.

schnabler
  • 508
  • 6
  • 20

3 Answers3

4

Try to clean your build directory:

Product-->Clean

Product-->(Alt key) Clean Build Folder

Delete your derived data:

Window-->Organizer-->delete derived data

zisoft
  • 21,200
  • 10
  • 56
  • 72
  • I did in fact try all of these steps multiples times, the error is still the same. – schnabler Aug 30 '14 at 12:28
  • 1
    What happens if you cmd-Click on "CoreLocation"? It should open the definition file. Another thought: Did you include the CoreLocationFramework to your project? – zisoft Aug 30 '14 at 12:41
  • 1
    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. – schnabler Aug 30 '14 at 12:55
  • Also, if I create a new project, everything just works fine in terms of CLLocationManagerDelegate. – schnabler Aug 30 '14 at 12:57
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.

Goodsquirrel
  • 1,396
  • 1
  • 12
  • 25
2

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

schnabler
  • 508
  • 6
  • 20