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

問題が見つかりました...他の人が同じ問題を抱えている場合に備えて:ライブラリとバイナリをリンクすると、 libEnsembles.alibPods.aが見つかりませんでした

于 2015-12-05T17:56:37.457 に答える