Search code examples
objective-ctargetcllocationocunit

CLLocation can't be found even though <CoreLocation/CoreLocation.h> is imported


#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>

@interface SomeClass : NSObject
{
    CLLocation *location;
    //...
}

//...

Code seems okay, right? But I still get "Unknown type name 'CLLocation'", even though CoreLocation.framework is imported to "Link Binary with Libraries" and CoreLocation.h is imported.

This error occured after I added a new target to the project - "Cocoa Touch Unit Testing Bundle". CoreLocation.framework is imported to this target, too.


Solution

  • Removing and adding the framework back is the best solution through which i solved a same problem.Also make sure you have added framework to unit test project.