Closed koenvanderdrift closed 10 years ago
Drag the project in your current project as a subproject. From there, you’ll need to add the libMagicaRecord.a static library into your linker step if Xcode doesn’t already do that for you. You may also have to set the -ObjC and -all_load flags to have all the categories in MagicalRecord be available for you. After that, you should be ok to continue as before, namely, import the CoreData+MagicalRecord header file and get started.
Saul Mora
Thanks Saul. Unfortunately it's not working yet, it looks like the MR libs are not compiling, see the screenshots attached.
Ah yes, you need to set your header search paths to “<SRCROOT/path/to/magicalrecord>/Library/**” Give that a try.
Still no luck :(
Maybe this is a clue, the scheme for libMagicalRecord-iOS is missing:
OK, it's working now, I had to add the scheme manually.
Edit: I spoke too early. The static lib is compiling now, but I still get the compile errors.
I went back to Xcode 5.0, and now I see a bunch of 'ARC Semantic Issue' errors:
Interestingly if I use MR 2.2, I also see 'ARC Semantic Issue' errors, with the exclamation mark in the red circle, but the project nevertheless compiles without an error.
Can you try again with the latest code in release/3.0
? I've put a lot of work into tidying things up this last few weeks.
I added the MR project file into my project, and added the static library to my build phase. I get the following error:
'CoreData+MagicalRecord.h' file not found
On Apr 8, 2014, at 9:44 AM, Tony Arnold notifications@github.com wrote:
Can you try again with the latest code in release/3.0? I've put a lot of work into tidying things up this last few weeks.
— Reply to this email directly or view it on GitHub.
It's just "MagicalRecord.h" now. We're still updating the docs.
Getting these errors now:
/Users/koen/Documents/Development/Projects/FrameWorks/MagicalRecord/Library/Categories/CoreData/NSManagedObjectContext/NSManagedObjectContext+MagicalObserving.m:90:59: No visible @interface for 'NSManagedObjectContext' declares the selector 'isEqualTo:'
/Users/koen/Documents/Development/Projects/iOS/InDigestion/InDigestion/IDAppDelegate.m:58:20: No known class method for selector 'setupCoreDataStackWithStoreNamed:'
/Users/koen/Documents/Development/Projects/iOS/InDigestion/InDigestion/IDAppDelegate.m:91:30: No known class method for selector 'MR_defaultContext'
/Users/koen/Documents/Development/Projects/iOS/InDigestion/InDigestion/IDSearchResultViewController.m:319:20: No known class method for selector 'saveWithBlock:completion:'
On Apr 8, 2014, at 6:27 PM, Tony Arnold notifications@github.com wrote:
It's just "MagicalRecord.h" now. We're still updating the docs.
— Reply to this email directly or view it on GitHub.
Please try a fresh checkout — that use of isEqualTo:
wasn't valid, so I've replaced it with isEqual:
.
As for the other errors, can you share the code from your project that the errors are referring to?
Here's some code:
` [MagicalRecord setupCoreDataStackWithStoreNamed: kIDStoreName];
[[NSManagedObjectContext MR_defaultContext] MR_saveToPersistentStoreAndWait];
self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest: fetchRequest
managedObjectContext: [NSManagedObjectContext MR_defaultContext]
sectionNameKeyPath: nil
cacheName: nil];
`
OK, so a lot has changed in MagicalRecord 3.0 — we're rewriting the docs at the moment, but your code needs to be updated. I've started writing a "Concepts" guide for MagicalRecord 3.0, but not a 2.x to 3.x migration guide yet.
It might be best if you wait until we've finished the first round of changes to the documentation.
So your code would look more like:
ClassicSQLiteMagicalRecordStack *defaultStack =
[ClassicSQLiteMagicalRecordStack stackWithStoreNamed:kIDStoreName];
[MagicalRecordStack setDefaultStack:defaultStack];
NSManagedObjectContext *defaultContext =
[[MagicalRecordStack defaultStack] context];
[defaultContext MR_saveToPersistentStoreAndWait];
self.fetchedResultsController =
[[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest
managedObjectContext:defaultContext
sectionNameKeyPath:nil
cacheName:nil];
Sounds good. I made a branch for MR 3.0 on my project where I can do some testing with the code examples you provided. I'll post back here later with my progress.
On Tue, Apr 8, 2014 at 7:36 PM, Tony Arnold notifications@github.comwrote:
OK, so a lot has changed in MagicalRecord 3.0 — we're rewriting the docs at the moment, but your code needs to be updated. I've started writing a "Concepts" guide for MagicalRecord 3.0 http://wiki/MagicalRecord-3:-Concepts, but not a 2.x to 3.x migration guide yet.
It might be best if you wait until we've finished the first round of changes to the documentation.
— Reply to this email directly or view it on GitHubhttps://github.com/magicalpanda/MagicalRecord/issues/672#issuecomment-39914394 .
No problems. I'll close this issue for now — feel free to re-open it if you feel the issue needs to be further addressed (we have separate issues for documentation and the change log already filed. Thanks!
Made good progress and all the changes, except for [MagicalRecord saveWithBlock: ^(NSManagedObjectContext *localContext)
. What's the MR 3.0 replacement for that method?
[[MagicalRecordStack defaultStack] saveWithBlock:^(NSManagedObjectContext *localContext) {
// …
}];
You can replace [MagicalRecordStack defaultStack]
with an instance of the stack.
With MR 2.2, I dragged the MR folder inside the main folder into my project With the newer 3.0 branch, there is no longer such a folder, instead there now is a Library folder. If I drag that one into my project, I get lots of compiler errors for missing MagicalRecord components. If I drag the complete MR folder into my project, same thing.
The Install docs still have the instructions for 2.2.
How I can I try the 3.0 branch in my project?