Using 3.0 branch in my project #672

Closed
koenvanderdrift opened this Issue Feb 13, 2014 · 17 comments

3 participants

@koenvanderdrift

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?

@casademora
Magical Panda Software member
@koenvanderdrift

Thanks Saul. Unfortunately it's not working yet, it looks like the MR libs are not compiling, see the screenshots attached.

screen shot 2014-02-13 at 11 53 13 am
screen shot 2014-02-13 at 10 52 33 am

@casademora
Magical Panda Software member
@koenvanderdrift

Still no luck :(

screen shot 2014-02-13 at 12 07 14 pm

Maybe this is a clue, the scheme for libMagicalRecord-iOS is missing:

screen shot 2014-02-13 at 12 08 53 pm

@koenvanderdrift

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.

@koenvanderdrift

I went back to Xcode 5.0, and now I see a bunch of 'ARC Semantic Issue' errors:

screen shot 2014-02-15 at 12 52 49 pm

screen shot 2014-02-15 at 12 53 07 pm

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.

@tonyarnold

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.

@koenvanderdrift
@tonyarnold

It's just "MagicalRecord.h" now. We're still updating the docs.

@koenvanderdrift
@tonyarnold

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?

@koenvanderdrift
@tonyarnold

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];
@koenvanderdrift
@tonyarnold

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!

@tonyarnold tonyarnold closed this Apr 10, 2014
@tonyarnold tonyarnold self-assigned this Apr 10, 2014
@koenvanderdrift

Made good progress and all the changes, except for [MagicalRecord saveWithBlock: ^(NSManagedObjectContext *localContext). What's the MR 3.0 replacement for that method?

@tonyarnold
[[MagicalRecordStack defaultStack] saveWithBlock:^(NSManagedObjectContext *localContext) { 
    // … 
}];

You can replace [MagicalRecordStack defaultStack] with an instance of the stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment