Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode Beta 6 - Use of undeclared type 'CLLocationManagerDelegate'

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.

like image 794
schnabler Avatar asked Aug 30 '14 11:08

schnabler


3 Answers

Try to clean your build directory:

Product-->Clean

Product-->(Alt key) Clean Build Folder

Delete your derived data:

Window-->Organizer-->delete derived data

like image 54
zisoft Avatar answered Nov 10 '22 04:11

zisoft


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.

like image 23
Goodsquirrel Avatar answered Nov 10 '22 06:11

Goodsquirrel


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

like image 41
schnabler Avatar answered Nov 10 '22 04:11

schnabler