0

这是我试图合并到我的应用程序中的代码(从“书”复制和修改)(它基本上与我在另一个应用程序(2014 年)中使用的代码相同,我没有得到任何构建/链接器错误):

//  Ensemble: load the model
NSManagedObjectModel *model = [NSManagedObjectModel MR_newManagedObjectModelNamed:@"Books.momd"];
[NSManagedObjectModel MR_setDefaultManagedObjectModel:model];

//  setup CoreData stack
[MagicalRecord setShouldAutoCreateManagedObjectModel:NO];
[MagicalRecord setupCoreDataStackWithAutoMigratingSqliteStoreNamed:@"bim.sqlite"];  //  enable Core Data migration

//  setup Ensemble
NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"Books" withExtension:@"momd"];
NSURL *storeURL = [NSPersistentStore MR_urlForStoreName: [MagicalRecord defaultStoreName]];

//     setup Ensemble (NOTE: the following 3 lines are causing the errors)
cloudFileSystem = [[CDEICloudFileSystem alloc] initWithUbiquityContainerIdentifier: @"iCloud.com.pragerphoneapps.BookstoreInventoryManager"];

ensemble = [[CDEPersistentStoreEnsemble alloc] initWithEnsembleIdentifier:@"BookInventoryMgr"
                                                       persistentStoreURL: storeURL
                                                    managedObjectModelURL:modelURL
                                                          cloudFileSystem:cloudFileSystem];
ensemble.delegate = self;

//  set default NSManagedObjectContext for MagicalRecord
defaultContext = [NSManagedObjectContext MR_defaultContext];  //  set default NSManagedObjectContext

//  leech it is next

我收到这些链接器错误:

Ld /Users/rolfmarsh/Library/Developer/Xcode/DerivedData/BookstoreInventoryManager-ehprguuncdbjjpeteojkrlqtyyym/Build/Products/Debug-iphonesimulator/BookstoreInventoryManager.app/BookstoreInventoryManager normal i386
cd "/Users/rolfmarsh/Documents/iPad Projects/BookstoreInventoryManager"
export IPHONEOS_DEPLOYMENT_TARGET=8.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.1.sdk -L/Users/rolfmarsh/Library/Developer/Xcode/DerivedData/BookstoreInventoryManager-ehprguuncdbjjpeteojkrlqtyyym/Build/Products/Debug-iphonesimulator -F/Users/rolfmarsh/Library/Developer/Xcode/DerivedData/BookstoreInventoryManager-ehprguuncdbjjpeteojkrlqtyyym/Build/Products/Debug-iphonesimulator -F/Users/rolfmarsh/Documents/iPad\ Projects/BookstoreInventoryManager/BookstoreInventoryManager -F/Users/rolfmarsh/Documents/iPad\ Projects/BookstoreInventoryManager -filelist /Users/rolfmarsh/Library/Developer/Xcode/DerivedData/BookstoreInventoryManager-ehprguuncdbjjpeteojkrlqtyyym/Build/Intermediates/BookstoreInventoryManager.build/Debug-iphonesimulator/BookstoreInventoryManager.build/Objects-normal/i386/BookstoreInventoryManager.LinkFileList -mios-simulator-version-min=8.0 -Xlinker -objc_abi_version -Xlinker 2 -lz -ObjC -fobjc-arc -fobjc-link-runtime -lz -lsqlite3 -framework Security -framework QuartzCore -lxml2 -framework Fabric -framework Crashlytics -framework CoreGraphics -framework UIKit -framework CloudKit -framework Foundation -lPods -Xlinker -dependency_info -Xlinker /Users/rolfmarsh/Library/Developer/Xcode/DerivedData/BookstoreInventoryManager-ehprguuncdbjjpeteojkrlqtyyym/Build/Intermediates/BookstoreInventoryManager.build/Debug-iphonesimulator/BookstoreInventoryManager.build/Objects-normal/i386/BookstoreInventoryManager_dependency_info.dat -o /Users/rolfmarsh/Library/Developer/Xcode/DerivedData/BookstoreInventoryManager-ehprguuncdbjjpeteojkrlqtyyym/Build/Products/Debug-iphonesimulator/BookstoreInventoryManager.app/BookstoreInventoryManager

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_CDEICloudFileSystem", referenced from:
      objc-class-ref in AppDelegate.o
  "_OBJC_CLASS_$_CDEPersistentStoreEnsemble", referenced from:
      objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我该如何解决?

4

1 回答 1

0

找到了问题...以防万一其他人有同样的问题:Link Binaries with Libraries is missing libEnsembles.a and libPods.a

于 2015-12-05T17:56:37.457 回答