Super Awesome Easy Fetching for Core Data!

Overview

Awesome MagicalRecord

Circle CI

In software engineering, the active record pattern is a design pattern found in software that stores its data in relational databases. It was named by Martin Fowler in his book Patterns of Enterprise Application Architecture. The interface to such an object would include functions such as Insert, Update, and Delete, plus properties that correspond more-or-less directly to the columns in the underlying database table.

Active record is an approach to accessing data in a database. A database table or view is wrapped into a class; thus an object instance is tied to a single row in the table. After creation of an object, a new row is added to the table upon save. Any object loaded gets its information from the database; when an object is updated, the corresponding row in the table is also updated. The wrapper class implements accessor methods or properties for each column in the table or view.

- Wikipedia

MagicalRecord was inspired by the ease of Ruby on Rails' Active Record fetching. The goals of this code are:

  • Clean up my Core Data related code
  • Allow for clear, simple, one-line fetches
  • Still allow the modification of the NSFetchRequest when request optimizations are needed

Status of the project

This project's activity has stopped, superseded by Core Data itself. Our latest versions available are:

  • MagicalRecord 2.4.0, a stable version, available from tag '2.4.0' or pod 'MagicalRecord', :git => 'https://github.com/magicalpanda/MagicalRecord'.
  • MagicalRecord 3.0.0, an experimental version, available in two flavors, one is branch release/3.0 and the other is branch maintenance/3.0.

Documentation

Support

This project's activity has stopped. MagicalRecord is provided as-is, free of charge. For support, you have a few choices:

  • Ask your support question on Stack Overflow, and tag your question with MagicalRecord.
  • If you believe you have found a bug in MagicalRecord, please submit a support ticket on the GitHub Issues page for MagicalRecord or a pull request. Please do NOT ask general questions on the issue tracker. Support questions will be closed unanswered.
  • For more personal or immediate support, MagicalPanda is available for hire to consult on your project.
Comments
  • Importing Data

    Importing Data

    I'm getting a strange error (EXC_BAD_ACCESS by CFStringGetLength within NSManagedObject(MagicalRecord)MR_executeFetchRequest:inContext:) I can't make sense of when attempting to import data from a JSON file...

    NSManagedObjectContext *opContext = [NSManagedObjectContext MR_contextForCurrentThread];
    
        NSString *jsonPath = [[NSBundle mainBundle] pathForResource:@"DefaultData"
                                                             ofType:@"json"];
        NSData *data = [NSData dataWithContentsOfFile:jsonPath];
    
        NSError *parseError;
        NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&parseError];
    
        NSArray *dataTypes = [json objectForKey:@"dataTypes"];
    
        [MagicalRecord saveWithBlockAndWait:^(NSManagedObjectContext *localContext) {
            for (NSDictionary *obj in dataTypes) {
                DLog(@"%@", obj);
                [BTDataType MR_importFromObject:obj inContext:localContext];
            }
        }];
    
        NSError *saveError;
        [opContext save:&saveError];
    

    The entity is very simple, just two properties: importKey (int16) and name (String)...

    The JSON is like...

    { "dataTypes":[ { "importKey":1000, "name":"DataType A" }, { "importKey":1001, "name":"DataType B" }, { "importKey":1002, "name":"DataType C" }, { "importKey":1003, "name":"DataType D" } ] }

    opened by emadd 42
  • Referenced non-public APIs which caused AppStore rejection.

    Referenced non-public APIs which caused AppStore rejection.

    First of all, great work on MagicalRecord. Coming from a ruby background, it made CoreData a whole lot easier.

    I had issues submitting my application this weekend and Apple's ApplicationLoader (the new one which scans private APIs) flagged the methods in this commit as issues (which caused rejection of binary). The error from Apple was:

    The app references non-public selectors in PocketSalsa.app/ PocketSalsa: entityInManagedObjectContext:, insertInManagedObjectContext.

    After editing my fork and making sure my edits worked, I resubmitted it and the binary it was finally accepted. There is probably a better fix for this, but I'm not an expert on MagicalRecord as you are.

    Thanks.

    Bug Needs Investigation 
    opened by apersaud 42
  • Cocoapods 0.36 CocoaLumberjack error

    Cocoapods 0.36 CocoaLumberjack error

    I upgraded my project to use Cocoapods 0.36 and I started to fix the errors that causes. One of the errors I was getting is the following:

    Undefined symbols for architecture x86_64:
      "_OBJC_CLASS_$_DDLog", referenced from:
          objc-class-ref in MagicalRecord+ErrorHandling.o
          objc-class-ref in NSManagedObject+MagicalDataImport.o
          objc-class-ref in NSManagedObject+MagicalRecord.o
          objc-class-ref in NSManagedObjectContext+MagicalObserving.o
          objc-class-ref in NSManagedObjectContext+MagicalRecord.o
          objc-class-ref in NSManagedObjectContext+MagicalSaves.o
          objc-class-ref in NSObject+MagicalDataImport.o
          ...
    

    In my project I have both CocoaLumberjack as MagicalRecord in my Podfile. I solved it by adding CocoaLumberjack.framework to the Link Binary With Libraries in the Pods-MagicalRecord target my Pods project has, but I am not sure that is the way to go.

    Bug Needs Investigation Needs Confirmation 
    opened by depl0y 38
  • Starting MagicalRecord hangs, unrecognized selector

    Starting MagicalRecord hangs, unrecognized selector "swizzleShorthandMethods".

    In a Mac OS application running on 10.8, I call [MagicalRecord setupCoreDataStack] in my applicationDidFinishLaunching: method.

    There are no errors or warnings in Xcode, I've got MR_SHORTHAND defined in my PCH file, and I've done a clean build.

    With a breakpoint on that line I'm unable to go down into the method call, which would imply that the problem is happening in the initialization of the class MagicalRecord, which from looking around issues here seems to be where the method swizzling is performed.

    If I disable MR_SHORTHAND it seems to work, but I'm not sure why this is the case. I'm importing MagicalRecord in each implementation file I want to use it in rather than putting it in the PCH, but even if it's put in the PCH after MR_SHORTHAND, it makes no difference.

    Why is it not finding the method? A breakpoint on [self swizzleShorthandMethods] in MagicalRecord.m is hit, so it's definitely defined.

    Why would this problem cause MagicalRecord to just hang? Surely it should just not swizzle the methods, or at the worst, crash because the selector wasn't recognised?

    Other info: using version 2.1 from CocoaPods.

    opened by danpalmer 30
  • ARC Memory Leak

    ARC Memory Leak

    I have just joined a project with uses MagicRecord. I have run the app through instruments and get repeated leaks on the following code on the executeFetchRequest method:

    + (NSArray *)MR_executeFetchRequest:(NSFetchRequest *)request inContext:(NSManagedObjectContext *)context
    {
        __block NSArray *results = nil;
        [context performBlockAndWait:^
        {
            NSError *error = nil;
    
            results = [context executeFetchRequest:request error:&error];
    
            if (results == nil)
            {
                [MagicalRecord handleErrors:error];
            }
    
        }];
        return results;
    }
    

    I am new to MagicalRecord but any help you can give would be greatly appreciated.

    Thanks,

    Dean

    Bug Performance Awaiting Reply Needs Confirmation 
    opened by zenuviDev 29
  • EXC_BAD_ACCESS when app is updated from App Store

    EXC_BAD_ACCESS when app is updated from App Store

    when an app is updated from the app store, it crashes at first launch (after the update) with the crash log below. This happens at the first attempt to save to the persistent store. deleting and re-installing the app fixes the issue - potentially related to Core Data migration issues?

    Remark: the core data stack is setup via setupCoreDataStackWithAutoMigratingSqliteStoreNamed:

    thanks for any hints!

    Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x00000008 Crashed Thread: 0

    Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 libsystem_kernel.dylib 0x3935f838 __kill + 8 1 APPNAME-TEST 0x001797dc CLSSignalHandler + 188 2 libsystem_c.dylib 0x392e0d38 _sigtramp + 40 3 Foundation 0x319e5b2c -[NSError dealloc] + 56 4 libobjc.A.dylib 0x38e69490 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 164 5 CoreFoundation 0x310b482c _CFAutoreleasePoolPop + 12 6 Foundation 0x319e6d86 -[NSAutoreleasePool drain] + 118 7 CoreData 0x30f6a6ac -[NSManagedObjectContext save:] + 1204 8 APPNAME-TEST 0x000f38f4 __70-[NSManagedObjectContext(MagicalSaves) MR_saveWithOptions:completion:]_block_invoke3 + 136 9 CoreData 0x30f6ddb6 developerSubmittedBlockToNSManagedObjectContextPerform + 86 10 CoreData 0x30f6dee6 -[NSManagedObjectContext performBlockAndWait:] + 90 11 APPNAME-TEST 0x000f3828 -[NSManagedObjectContext(MagicalSaves) MR_saveWithOptions:completion:] + 248 12 APPNAME-TEST 0x00051c22 -BBModel storeInfo: 13 APPNAME-TEST 0x0004720a __29-[BBModel loadInfoWithBlock:]_block_invoke (BBModel.m:1608) 14 APPNAME-TEST 0x00094cb4 __74+[AFJSONRequestOperation JSONRequestOperationWithRequest:success:failure:]_block_invoke + 96 15 libdispatch.dylib 0x39286790 _dispatch_call_block_and_release + 8 16 libdispatch.dylib 0x392865d8 _dispatch_client_callout + 20 17 libdispatch.dylib 0x39289e40 _dispatch_main_queue_callback_4CF + 224 18 CoreFoundation 0x311451ac __CFRunLoopRun + 1284 19 CoreFoundation 0x310b8238 CFRunLoopRunSpecific + 352 20 CoreFoundation 0x310b80c4 CFRunLoopRunInMode + 100 21 GraphicsServices 0x34c97336 GSEventRunModal + 70 22 UIKit 0x32fd42b4 UIApplicationMain + 1116 23 APPNAME-TEST 0x0003cf0e main (main.m:16) 24 APPNAME-TEST 0x0003cec4 start + 36

    opened by roland9 29
  • No shorthand in unit test

    No shorthand in unit test

    I use magicalRecord in my project and i use it even inside UnitTest. But inside unit test shorthands are not recognized.

    I use cocoapod to manage dipendencies.

    Support Awaiting Reply 
    opened by ignazioc 28
  • App Crashed - updating the older one which doesnot have coredata model to New ios Build which has Core data Model

    App Crashed - updating the older one which doesnot have coredata model to New ios Build which has Core data Model

    Using MagicalRecord for Coredata

    Please find the below crash logs

    Thread 0 Crashed: 0 libobjc.A.dylib 0x3b3e7626 objc_msgSend + 6 1 Foundation 0x31223028 -[NSError dealloc] + 56 2 libobjc.A.dylib 0x3b3ecb66 objc_object::sidetable_release(bool) + 170 3 libobjc.A.dylib 0x3b3ed0ce (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 354 4 CoreFoundation 0x308344bc _CFAutoreleasePoolPop + 12 5 Foundation 0x3122d8de -[NSAutoreleasePool drain] + 118 6 CoreData 0x30674fba -[NSManagedObjectContext save:] + 938 7 tibbr 0x002c7e16 0x5e000 + 2530838 8 CoreData 0x306d89ca developerSubmittedBlockToNSManagedObjectContextPerform + 86 9 CoreData 0x306d8b0e -[NSManagedObjectContext performBlockAndWait:] + 110 10 tibbr 0x002c7d66 0x5e000 + 2530662 11 CoreData 0x306d89ca developerSubmittedBlockToNSManagedObjectContextPerform + 86 12 CoreData 0x306d8b0e -[NSManagedObjectContext performBlockAndWait:] + 110

    I am Utilizing - saveUsingCurrentThreadContextWithBlockAndWait for saving the data synchronously

    Support 
    opened by sundarsan 27
  • Odd behavior while managing multiple data stores

    Odd behavior while managing multiple data stores

    I'm trying to convert multiple databases (made of plist files), into multiple core data databases, and am experiencing some odd behavior. (especially after the commit on Oct 2nd).

    I'm converting the databases with a loop preforming in a background thread and in the main thread;

    • I start in the background thread, creating a stack with setupCoreDataStackWithStoreNamed:.
    • Then I add all of my entities and save in the background thread.
    • Calling back to the main thread I preform [MagicalRecord cleanUp]; and release the background thread.
    • If I need to convert another database, I recreate the background thread, and preform these actions again.

    First, [MagicalRecord cleanUp] is not tearing down and deallocating the entire data stack. The same NSPersistentStoreCoordinator is reused each loop, and one the same three NSManagedObjectContexts that are created are reused each time. If I use NSLogs to check the values of these objects in MagicalRecord.h, they are set to nil after cleanUp, but during the start of the next loop they are recovered, and used again. Causing each separate database being saved to be saved to the first store that is created, and ignoring the last created store.

    Second, [NSManagedObjectContext MR_resetContextForCurrentThread]; or any similar reset method is not "forgetting" all of its NSManagedObjects. And when the context gets reused, all of the data from the previous database still exists.

    Third, before the October 2nd update, directly after calling [managedObjectContext MR_saveNestedContexts]; I was able to preform [NSManagedObjectContext MR_resetContextForCurrentThread]; immediately afterward without error. After October 2nd, If I reformed this method, on the next loop I would get an assertion failure *** Assertion failure in +[NSManagedObjectContext MR_defaultContext]

    Before this update it was my understanding that when MagicalRecord saves on a background thread, it copies the NSManagedObjectContext being saved. So I can edit the context after saving, and nothing would happen to the saving context. Has this changed?

    I tried to make this issue as non-application specific as I could. If you want to see what I'm doing specifically, I have a stackOverflow question with my code: http://stackoverflow.com/questions/12700590/switching-between-core-data-stores

    opened by Marxon13 27
  • Provide a way to disable SQLite journalling mode

    Provide a way to disable SQLite journalling mode

    Currently MagicalRecord uses the WAL journal_mode when creating an auto migrating store. Since I don't want to use that kind of journal_mode an option for disabling the WAL journal mode would be useful.

    opened by sebromero 24
  • Use MagicalRecord with another existing context in RestKit

    Use MagicalRecord with another existing context in RestKit

    This is a question not an issue.

    I want to keep using my current RestKit while use MagicRecord for rest of fetches and updates. After I reading issue #156, I want to double check if I am doing correctly.

    NSManagedObjectContext* context = [[RKObjectManager sharedManager].objectStore managedObjectContextForCurrentThread];
    [MagicalRecord setupCoreDataStackWithAutoMigratingSqliteStoreNamed:[XDBStore storeName]];
    [context setParentContext:[NSManagedObjectContext MR_defaultContext]];
    
    opened by angeloh 24
  • Model.mapping(map: Map(mappingType: .fromJSON, JSON: meetingJson)) not saving ID

    Model.mapping(map: Map(mappingType: .fromJSON, JSON: meetingJson)) not saving ID

    params- mapping before != nil Optional(3134620) params- mapping after Optional(3134620) nil params- saveInContext(meetingJson: Optional(3134620) params- meetingFind 0 why my id is nil ? any idea?

        public static func saveInContext(meetingJson: [String : Any], source: MeetingSource, completion: ((MeetingModel?) -> Void)? = nil) {
            
            MagicalRecord.save { context in
                context.mergePolicy = NSMergePolicy(merge: NSMergePolicyType.overwriteMergePolicyType)
                let ctx = MapManagedObjectContext(context: context)
                var meeting = MeetingModel.mr_findFirst(with: NSPredicate(format: "id=%@", meetingJson["id"] as! CVarArg), in: ctx.ctx)
                if meeting != nil {
                    print("params- mapping before != nil", meeting?.id )
                    meeting?.mapping(map: Map(mappingType: .fromJSON, JSON: meetingJson))
                    print("params- mapping after", meeting?.id, meetingRes?.id )
                } else {
                    print("params- mapping before == nil", meeting?.id )
                    meeting = Mapper<MeetingModel>(context: ctx).map(JSON: meetingJson)
                    print("params- mapping before == nil", meeting?.id)
                }
                meeting?.source = Int16(source.rawValue)
                
                if let profJson = meetingJson["prof"] as? [String : Any] {
                    if let login = profJson["login"] as? String {
                        let profile = OtherUserModel.mr_findFirst(with: NSPredicate(format: "login = %@", login), in: ctx.ctx)
                        if profile != nil {
                            profile!.mapping(map: Map(mappingType: .fromJSON, JSON: profJson))
                            meeting?.prof = profile
                        } else {
                            let profile = Mapper<OtherUserModel>(context: ctx).map(JSON: profJson)
                            meeting?.prof = profile
                        }
                    }
                }
                print("params- saveInContext(meetingJson:", meeting?.id )
                
                if let meetingFind = MeetingModel.mr_findFirst(with: NSPredicate(format: "source == \(MeetingSource.my.rawValue)")) {
                    print("params- meetingFind", meetingFind.id )
                }
                
            } completion: { result, error in
                completion?(getMyMeeting())
            }
            
        }
    
    
        public static func getMyMeeting() -> MeetingModel? {
            if let meeting = MeetingModel.mr_findFirst(with: NSPredicate(format: "source == \(MeetingSource.my.rawValue)")) {
                return meeting
            }
            return nil
        }
    
    opened by addame2 0
  • Causing crash when i run my project in Xcode 13

    Causing crash when i run my project in Xcode 13

    It was all working fine till Xcode 12.5. But when i run my project on Xcode 13 ending up with the crash. Below is the crash log. Please help me out. Thanks in advance.

    2022-05-05 11:34:03.230149+0530 XXXXX[26651:2999865] -[NSKnownKeysDictionary1 objectID]: unrecognized selector sent to instance 0x600002cdbd00 2022-05-05 11:34:03.247575+0530 XXXXX[26651:2999865] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSKnownKeysDictionary1 objectID]: unrecognized selector sent to instance 0x600002cdbd00' *** First throw call stack: ( 0 CoreFoundation 0x00007fff203fbbb4 __exceptionPreprocess + 242 1 libobjc.A.dylib 0x00007fff2019ebe7 objc_exception_throw + 48 2 CoreFoundation 0x00007fff2040a821 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0 3 CoreFoundation 0x00007fff204000bc forwarding + 1433 4 CoreFoundation 0x00007fff204021e8 _CF_forwarding_prep_0 + 120 5 CoreData 0x00007fff25b5f5d4 __82-[NSManagedObjectContext(_NestedContextSupport) executeRequest:withContext:error:]_block_invoke + 2820 6 CoreData 0x00007fff25b61a0d internalBlockToNSManagedObjectContextPerform + 89 7 libdispatch.dylib 0x00000001089cdc0c _dispatch_client_callout + 8 8 libdispatch.dylib 0x00000001089dd1f7 _dispatch_lane_barrier_sync_invoke_and_complete + 132 9 CoreData 0x00007fff25b48f4b _perform + 196 10 CoreData 0x00007fff25b5e999 -[NSManagedObjectContext(_NestedContextSupport) executeRequest:withContext:error:] + 175 11 CoreData 0x00007fff25b4bf04 -[NSManagedObjectContext executeFetchRequest:error:] + 898 12 XXXXX 0x0000000108053f33 __67+[NSManagedObject(MagicalRecord) MR_executeFetchRequest:inContext:]_block_invoke + 67 13 CoreData 0x00007fff25b52426 developerSubmittedBlockToNSManagedObjectContextPerform + 151 14 CoreData 0x00007fff25b52310 -[NSManagedObjectContext performBlockAndWait:] + 197 15 XXXXX 0x0000000108053d9f +[NSManagedObject(MagicalRecord) MR_executeFetchRequest:inContext:] + 319 16 XXXXX 0x000000010805402f +[NSManagedObject(MagicalRecord) MR_executeFetchRequest:] + 127 17 XXXXX 0x0000000107ddb73c -[function] + 2380 18 XXXXX 0x0000000107dd9943 -[function] + 355 19 XXXXX 0x0000000107dd9114 __49-[function]_block_invoke + 324 20 XXXXX 0x0000000107cba301 __111-[NetworkAPIManager(function)response:]_block_invoke.76 + 1249 21 XXXXX 0x000000010805ab9d __70-[NSManagedObjectContext(MagicalSaves) MR_saveWithOptions:completion:]_block_invoke_2 + 45 22 libdispatch.dylib 0x00000001089cca28 _dispatch_call_block_and_release + 12 23 libdispatch.dylib 0x00000001089cdc0c _dispatch_client_callout + 8 24 libdispatch.dylib 0x00000001089dc376 _dispatch_main_queue_callback_4CF + 1195 25 CoreFoundation 0x00007fff2036985d CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9 26 CoreFoundation 0x00007fff203640ba __CFRunLoopRun + 2772 27 CoreFoundation 0x00007fff20363103 CFRunLoopRunSpecific + 567 28 GraphicsServices 0x00007fff2c851cd3 GSEventRunModal + 139 29 UIKitCore 0x00007fff24ffbe63 -[UIApplication _run] + 928 30 UIKitCore 0x00007fff25000a53 UIApplicationMain + 101 31 XXXXX 0x0000000107e6a098 main + 104 32 dyld 0x000000010884ae1e start_sim + 10 33 ??? 0x0000000000000001 0x0 + 1 ) libc++abi: terminating with uncaught exception of type NSException

    Crash is happening in below code part

    • (NSArray *) MR_executeFetchRequest:(NSFetchRequest *)request inContext:(NSManagedObjectContext *)context { __block NSArray *results = nil; [context performBlockAndWait:^{

        NSError *error = nil;
      
        results = [context executeFetchRequest:request error:&error];
      
        if (results == nil) 
        {
            [MagicalRecord handleErrors:error];
        }
      

      }]; return results; }

    opened by Kiran-3172 1
  • version   diff    crash

    version diff crash

    2022-04-27 17:23:06.088014+0800 demo[34168:2674622] → Saving <NSManagedObjectContext (0x282e2c750): MagicalRecord Default Context> on the main thread 2022-04-27 17:23:13.445435+0800 demo[34168:2674622] Error: Can't resolve how to assign objects to stores; Coordinator does not have any stores 2022-04-27 17:23:13.445983+0800 demo[34168:2674622] Error Message: 用来打开储存的型号配置与用来创建该储存的型号配置不兼容。 2022-04-27 17:23:13.446324+0800 demo[34168:2674622] Error Domain: NSCocoaErrorDomain 2022-04-27 17:23:13.447010+0800 demo[34168:2674622] Recovery Suggestion: (null) 2022-04-27 17:23:13.451494+0800 demo[34168:2674622] → Saving <NSManagedObjectContext (0x282e2c750): MagicalRecord Default Context> on the main thread 2022-04-27 17:23:13.451510+0800 demo[34168:2674847] → Saving <NSManagedObjectContext (0x282e2c410): MagicalRecord Root Saving Context> on a background thread

    crash

    opened by korea1501541730 0
  • Invalid value for key 'relatedByAttribute'

    Invalid value for key 'relatedByAttribute'

    Invalid value for key 'relatedByAttribute' in 'ACFloor' entity. Remove this key or add attribute 'aCFloorID' Invalid value for key 'relatedByAttribute' in 'ACFloor' entity. Remove this key or add attribute 'aCFloorID' Invalid value for key 'relatedByAttribute' in 'ACFloor' entity. Remove this key or add attribute 'aCFloorID' image

    opened by korea1501541730 0
  • How to get rid of “-Warc-performSelector-leaks” warning for Xcode12.5 with SEL IMP

    How to get rid of “-Warc-performSelector-leaks” warning for Xcode12.5 with SEL IMP

    How to get rid of "-Warc-performSelector-leaks" warning with a argument based selector

    Old code resulting in deprecation error with Xcode12.5

    From the Magical Record repo.

    #pragma clang diagnostic push
    #pragma clang diagnostic ignored \
        "-Warc-performSelector-leaks"
            if (implementsShouldImport && !(BOOL)[self performSelector:shouldImportSelector withObject:relatedObjectData])
            {
                continue;
            }
    #pragma clang diagnostic pop
    

    Note: Ignoring the warning with #pragma clang diagnostic push isn't working.

    Updated Logic

            if (implementsShouldImport) {
                IMP shouldImportImplementation = [self methodForSelector:shouldImportSelector];
                BOOL (*func)(id, shouldImportSelector, id) = (void *)shouldImportImplementation;
                if (!func(id, shouldImportSelector, relatedObjectData)) {
                    continue;
                }
            }
    

    Resulting in two errors:

    • Type specifier missing, defaults to 'int' for BOOL (*func)(id, shouldImportSelector, id) = (void *)shouldImportImplementation;
    • Unexpected type name 'id': expected expression for line if (!func(id, shouldImportSelector, relatedObjectData)) {

    Adopting the answer here

    How to get rid of "Warc-performSelector-leaks" warning.

    Magical Record is unmaintained open source library that is resulting in error with Xcode12.5 compilation.

    opened by angelaTen 0
Releases(v2.3.3)
  • v2.3.3(Jan 29, 2016)

    This release is mainly for Carthage users: the previous release had it's binaries compiled against the Xcode 7.3 beta tools. This release is compiled using the release version of Xcode 7.2.

    MagicalRecord 2.3 is the final 2.x point release of MagicalRecord. It is also the final release that will support the iOS 6 and OS X 10.8 SDKs.

    Source code(tar.gz)
    Source code(zip)
    MagicalRecord.framework.zip(3.48 MB)
  • v2.3.2(Jan 21, 2016)

    This release fixes an issue where the OS X framework was being built with instrumentation data, and included in the binary builds posted to GitHub. It contains no other fixes over MagicalRecord v2.3.1.

    MagicalRecord 2.3 is the final 2.x point release of MagicalRecord. It is also the final release that will support the iOS 6 and OS X 10.8 SDKs.

    Source code(tar.gz)
    Source code(zip)
    MagicalRecord.framework.zip(1.59 MB)
  • v2.3.1(Jan 21, 2016)

    This is primarily a bug fix release to address a host of issues reported in MagicalRecord 2.3.0.

    • CocoaPods users who want to use:
      • Shorthand method aliases should add pod 'MagicalRecord/ShorthandMethodAliases' to their Podfile, and run pod update
      • CocoaLumberjack should add pod 'MagicalRecord/CocoaLumberjack' to their Podfile, and run pod update
    • Fixed a Core Data multithreading violation when setting a context's working name
    • Fixed the check for whether NSPersistentStoreUbiquitousContentNameKey is valid when using iCloud containers
    • Attempting to delete a nil managed object, or a managed object not present in the context will do nothing (previously it crashed)
    • Add a fix for CocoaLumberjack reporting duplicate definitions of LOG_MAYBE
    • Added error logging when the passed value for relatedByAttribute is invalid during a relationship import
    • Added more lightweight generics and nullability annotations

    MagicalRecord 2.3 is the final 2.x point release of MagicalRecord. It is also the final release that will support the iOS 6 and OS X 10.8 SDKs.

    Thanks to everyone who contributed to this release!

    Source code(tar.gz)
    Source code(zip)
  • v2.3.0(Jun 1, 2015)

    What's new?

    • Dynamic framework targets are provided for both OS X 10.8+ and iOS 8.0+

    • Logging is enabled by default, change the logging level using +[MagicalRecord setLoggingLevel: MagicalRecordLogLevelOff];see the documentation in the wiki

    • CocoaLumberjack 2.0 support

    • Enabling shorthand category method names can now be done by importing:

      #import <MagicalRecord/MagicalRecord.h>
      #import <MagicalRecord/MagicalRecord+ShorthandMethods.h>
      #import <MagicalRecord/MagicalRecordShorthandMethodAliases.h>
      

      Then calling +[MagicalRecord enableShorthandMethods].
      See the documentation in the wiki.

    • Support for running with Core Data's concurrency debugging checks enabled

    • Many, many, many, many fixes to reported issues

    MagicalRecord 2.3 is the final 2.x point release of MagicalRecord. It is also the final release that will support the iOS 6 and OS X 10.8 SDKs.

    Thanks to everyone who contributed to this release!

    Source code(tar.gz)
    Source code(zip)
    MagicalRecord.framework.zip(3.06 MB)
  • v2.3.0-beta.6(May 23, 2015)

    MagicalRecord 2.3 is the final 2.x point release of MagicalRecord. It is also the final release that will support the iOS 6 and OS X 10.8 SDKs.

    • Added a dynamic framework target for iOS 8 and higher — if need to use MagicalRecord with releases prior to iOS 8.0, please use the static library target.
    • Revised logging setup so that logging will work within the framework targets.
    • Revised how shorthand is activated so that it will work within the framework targets.
    • Added support for CocoaLumberjack 2.

    All that's left at this stage is for you guys to test in a few real-world applications, and update the documentation. Thank you to everyone who has contributed to this release!

    Source code(tar.gz)
    Source code(zip)
  • v2.3.0-beta.5(Nov 1, 2014)

    MagicalRecord 2.3 is the final 2.x point release of MagicalRecord. It is also the final release that will support the iOS 6.x and OS X 10.8 SDKs.

    What's changed since Beta 4?

    • Fixes -rootContextDidSave method, which was preventing saves for some users.

    Please report any issues you find and be sure to mention that you're using this version (v2.3.0-beta.5). We're hoping that this will be the final beta before MagicalRecord 2.3.0 is released, so please let us know if you find any glaring omissions or problems.

    Thank you to everyone who has contributed to this release!

    Source code(tar.gz)
    Source code(zip)
  • v2.3.0-beta.4(Oct 4, 2014)

    MagicalRecord 2.3 is the final 2.x point release of MagicalRecord. It is also the final release that will support the iOS 6.x and OS X 10.8 SDKs.

    What's changed since Beta 3?

    • Added support for specifying the where to save the persistent store file — see [MagicalRecord setupCoreDataStackWithStoreAtURL:…] and [MagicalRecord setupCoreDataStackWithAutoMigratingSqliteStoreAtURL:…]
    • Fixed reported concurrency issues under iOS 8.0 — it's still your responsibility to handle concurrency, but we aim not to do anything unexpected
    • Fixes logging messages during saves — it was being logged that the root saving context was being saved on the main thread
    • iOS sample project now works again

    Please report any issues you find and be sure to mention that you're using this version (v2.3.0-beta.4). We're hoping that this will be the final beta before MagicalRecord 2.3.0 is released, so please let us know if you find any glaring omissions or problems.

    Thank you to everyone who has contributed to this release!

    Source code(tar.gz)
    Source code(zip)
  • v2.3.0-beta.3(Jul 28, 2014)

    MagicalRecord 2.3 is the final 2.x point release of MagicalRecord. It is also the final release that will support the iOS 6.x and OS X 10.8 SDKs.

    What's changed since Beta 2?

    • Some minor fixes for iOS 8's stricter threading checks.
    • Missing imports have been added to headers they were supposed to be in.
    • We no longer swizzle -valueForUndefinedKey: when importing — the exception is caught and handled. This should result in a significant speed increase for larger imports. Please let us know if you find new exceptions being thrown when importing data.
    • More documentation has been added to the wiki

    Please report any issues you find and be sure to mention that you're using this version (v2.3.0-beta.3). We're hoping this will be the final beta before MagicalRecord 2.3.0 is released, so please let us know if you find any glaring omissions or problems.

    Thankyou to everyone who has contributed to this release!

    Source code(tar.gz)
    Source code(zip)
  • v2.3.0-beta.2(Apr 10, 2014)

    MagicalRecord 2.3 is the final 2.x point release of MagicalRecord. It is also the final release that will support the iOS 6.x and OS X 10.8 SDKs.

    What's changed since Beta 1?

    • MR_createInContext: has been deprecated in favour of the more consistent MR_createEntityInContext:
    • MR_deleteInContext: has been deprecated in favour of the more consistent MR_deleteEntityInContext:
    • Logging can now be controlled at runtime. It is not necessary to define MR_LOGGING_ENABLED — just use the new + [MagicalRecord setLogLevel: … ]; method — there is documentation on the new logging method in the wiki
    • Add MR_findFirstOrCreateByAttribute: … methods to the NSManagedObject+MagicalFinders category
    • Fix data imports so that the return value from -(BOOL)import<#AttributeName#>: data import methods is not ignored
    • Fix the return type of the - MR_aggregateOperation: … methods — it was never guaranteed that the return value would be an NSNumber, so the type is now id
    • Fix an issue where MR_clearContextForCurrentThread was not clearing the context cache version which would cause an assertion failure on the next call to MR_contextForCurrentThread
    • Restore + MR_fetchController: delegate: useFileCache: groupedBy: inContext: method to public header
    • Some documentation has been updated in the wiki, but it is very much a work in progress

    Please report any issues you find and be sure to mention that you're using this version (v2.3.0-beta.2)

    Thankyou to everyone who has contributed to this release!

    Source code(tar.gz)
    Source code(zip)
  • v2.3.0-beta.1(Apr 8, 2014)

    MagicalRecord 2.3 is the final 2.x point release of MagicalRecord. It is also the final release that will support the iOS 6.x and OS X 10.8 SDKs.

    What's new?

    • Saves should no longer block the main thread when saving on a background context
    • Enable support for passing nil to + createInContext: — this allows you to create entities that aren't associated with any context
    • Make -MR_inContext: work on entities with temporary NSManagedObjectIDs
    • Deleting an entity in a context other than it's own will delete the entity in the other context
    • Many fixes and improvements to the data import categories, including:
      • Fixes to importing relationships
      • Fixes timezone issues on dates when importing
      • Add support for importing NSDate attributes from UNIX timestamps
      • Add support for importing objects without a primary key (primaryAttribute) specified — this creates a new instance on each import
    • Added +[MagicalRecord version] that returns the current release as a double (see also MagicalRecordVersionNumber constant)
    • Added methods to perform aggregate operations on entities that can be grouped by a key path
    • Report an error if the persistent store fails to initialise when shouldDeleteStoreOnModelMismatch is set to NO
    • Clear cached NSManagedObjectContext instances that aren't on the main thread during cleanup
    • Updated documentation
    • Various smaller bug fixes and performance improvements

    Please report any issues you find and be sure to mention that you're using this version (v2.3.0-beta.1)

    Thankyou to everyone who has contributed to this release!

    Source code(tar.gz)
    Source code(zip)
Owner
Magical Panda Software
Magical Panda Software
A minimalistic, thread safe, non-boilerplate and super easy to use version of Active Record on Core Data.

Skopelos A minimalistic, thread-safe, non-boilerplate and super easy to use version of Active Record on Core Data. Simply all you need for doing Core

Alberto De Bortoli 235 Sep 9, 2022
JSON to Core Data and back. Swift Core Data Sync.

Notice: Sync was supported from it's creation back in 2014 until March 2021 Moving forward I won't be able to support this project since I'm no longer

Nes 2.5k Dec 31, 2022
Core Data Generator (CDG for short) is a framework for generation (using Sourcery) of Core Data entities from plain structs/classes/enums.

Core Data Generator Introduction Features Supported platforms Installation CDG Setup RepositoryType ModelType DataStoreVersion MigrationPolicy Basic U

Lotusflare 18 Sep 19, 2022
A powerful and elegant Core Data framework for Swift.

A powerful and elegant Core Data framework for Swift. Usage Beta version. New docs soon... Simple do that: let query = persistentContainer.viewContext

null 782 Nov 6, 2022
CloudCore is a framework that manages syncing between iCloud (CloudKit) and Core Data written on native Swift.

CloudCore CloudCore is a framework that manages syncing between iCloud (CloudKit) and Core Data written on native Swift. Features Leveraging NSPersist

deeje cooley 123 Dec 31, 2022
Unleashing the real power of Core Data with the elegance and safety of Swift

Unleashing the real power of Core Data with the elegance and safety of Swift Dependency managers Contact Swift 5.4: iOS 11+ / macOS 10.13+ / watchOS 4

John Estropia 3.7k Jan 9, 2023
JSQCoreDataKit - A swifter Core Data stack

JSQCoreDataKit A swifter Core Data stack About This library aims to do the following: Encode Core Data best practices, so you don't have to think "is

Jesse Squires 596 Dec 3, 2022
JustPersist is the easiest and safest way to do persistence on iOS with Core Data support out of the box.

JustPersist JustPersist is the easiest and safest way to do persistence on iOS with Core Data support out of the box. It also allows you to migrate to

Just Eat 167 Mar 13, 2022
QueryKit, a simple type-safe Core Data query language.

QueryKit QueryKit, a simple type-safe Core Data query language. Usage QuerySet<Person>(context, "Person")

QueryKit 1.5k Dec 20, 2022
HitList is a Swift App shows the implementation of Core Data.

HitList HitList is a Swift App shows the implementation of Core Data. It is the demo app of Ray Wenderlich's tech blog. For details please reference G

Kushal Shingote 2 Dec 9, 2022
A synchronization framework for Core Data.

Core Data Ensembles Author: Drew McCormack Created: 29th September, 2013 Last Updated: 15th February, 2017 Ensembles 2 is now available for purchase a

Drew McCormack 1.6k Dec 6, 2022
Core Data code generation

mogenerator Visit the project's pretty homepage. Here's mogenerator's elevator pitch: mogenerator is a command-line tool that, given an .xcdatamodel f

Wolf Rentzsch 3k Dec 30, 2022
A type-safe, fluent Swift library for working with Core Data

Core Data Query Interface (CDQI) is a type-safe, fluent, intuitive library for working with Core Data in Swift. CDQI tremendously reduces the amount o

null 31 Oct 26, 2022
A feature-light wrapper around Core Data that simplifies common database operations.

Introduction Core Data Dandy is a feature-light wrapper around Core Data that simplifies common database operations. Feature summary Initializes and m

Fuzz Productions 33 May 11, 2022
The Big Nerd Ranch Core Data Stack

BNR Core Data Stack The BNR Core Data Stack is a small Swift framework that makes it both easier and safer to use Core Data. A better fetched results

Big Nerd Ranch 561 Jul 29, 2022
100% Swift Simple Boilerplate Free Core Data Stack. NSPersistentContainer

DATAStack helps you to alleviate the Core Data boilerplate. Now you can go to your AppDelegate remove all the Core Data related code and replace it wi

Nes 216 Jan 3, 2023
Example repo of working with Core Data in a SwiftUI application

CoreData in SwiftUI This repository serves many purpose. But mostly so I can experiment with Core Data in SwiftUI, and also so I can use it show my ap

Donny Wals 4 Jan 30, 2022
This project server as a demo for anyone who wishes to learn Core Data in Swift.

CoreDataDemo This project server as a demo for anyone who wishes to learn Core Data in Swift. The purpose of this project is to help someone new to Co

null 1 May 3, 2022
SwiftUI - iOS notes App that integrates Core Data with SwiftUI App Life Cycle

Devote (Notes App) SwiftUI Masterclass project Integration between Core Data and SwiftUI App Life Cycle Custom Toggle style and checkbox Read, Update

Arthur Neves 3 Sep 3, 2022