I successfully added Ensembles using pods and compiled with no errors. Now I'm adding code to my AppDelegate.swift file. Build fails with
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_CDEPersistentStoreEnsemble", referenced from:
__TMaCSo26CDEPersistentStoreEnsemble in AppDelegate.o
"_CDEMonitoredManagedObjectContextDidSaveNotification", referenced from:
__TFC8nicepal11AppDelegate11applicationfS0_FTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVSs10DictionaryCSo8NSObjectPSs9AnyObject____Sb in AppDelegate.o
"_OBJC_CLASS_$_CDEICloudFileSystem", referenced from:
__TMaCSo19CDEICloudFileSystem in AppDelegate.o
"_CDEICloudFileSystemDidDownloadFilesNotification", referenced from:
__TFC8nicepal11AppDelegate11applicationfS0_FTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVSs10DictionaryCSo8NSObjectPSs9AnyObject____Sb in AppDelegate.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I think the relevant code in AppDelegate.swift is
var ensemble:CDEPersistentStoreEnsemble?
var ensembleCloudFileSystem:CDECloudFileSystem?
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, CDEPersistentStoreEnsembleDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
let store_url = self.applicationDocumentsDirectory.URLByAppendingPathComponent("nicepal.sqlite")
let modelURL = NSBundle.mainBundle().URLForResource("nicepal", withExtension: "momd")!
ensembleCloudFileSystem = CDEICloudFileSystem(
ubiquityContainerIdentifier: "something"
)
ensemble = CDEPersistentStoreEnsemble(
ensembleIdentifier: "IDENTIFIER",
persistentStoreURL: store_url,
managedObjectModelURL:modelURL,
cloudFileSystem:ensembleCloudFileSystem
)
ensemble?.delegate = self
NSNotificationCenter.defaultCenter().addObserver(self, selector: "syncWithCompletion:", name: CDEMonitoredManagedObjectContextDidSaveNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: "syncWithCompletion:", name: CDEICloudFileSystemDidDownloadFilesNotification, object: nil)
return true
}
My error is probably right in front of me, but I don't know.
my Bridging-Header.h looks like
#import <Foundation/Foundation.h>
#import <Ensembles/Ensembles.h>
#import "DropboxSDK.h"
#import "CDEDropboxCloudFileSystem.h"
Most likely your bridging header is not read.
Depending on your setup, maybe you also need to import the framework in your Swift file.