Reputation: 3907
I just started using MagicalRecord, and this might be a stupid question, but it's really bothering me... I am using MagicalRecord with sqlite, and when I initiate MagicalRecord, I used
[MagicalRecord setupCoreDataStackWithStoreNamed:@"OrderSystem.sqlite"];
and it produced the following messages:
2012-10-16 16:54:48.966 OrderSystem[4135:c07] +NSManagedObjectContext(MagicalRecord) MR_contextWithStoreCoordinator: -> Created : Context * MAIN THREAD *
When I tried to store my entity with the following code using a background thread:
[MagicalRecord saveInBackgroundWithBlock:^(NSManagedObjectContext *localContext){
Menu *localMenu = [menu inContext:localContext];
localMenu.name = menu.name;
localMenu.menuid = menu.menuid ;
}];
And I got the following error messages:
2012-10-16 17:05:20.118 OrderSystem[4523:4603] +MagicalRecord(ErrorHandling) defaultErrorHandler: Error Message: The operation couldn’t be completed. (Cocoa error 133000.)
2012-10-16 17:05:20.118 OrderSystem[4523:4603] +MagicalRecord(ErrorHandling) defaultErrorHandler: Error Domain: NSCocoaErrorDomain
2012-10-16 17:05:20.119 OrderSystem[4523:4603] +MagicalRecord(ErrorHandling) defaultErrorHandler: Recovery Suggestion: (null)
2012-10-16 17:05:20.119 OrderSystem[4523:4603] -NSManagedObjectContext(MagicalSaves) MR_saveWithErrorCallback: NO CHANGES IN CONTEXT : Context - NOT SAVING
2012-10-16 17:05:20.120 OrderSystem[4523:c07] -NSManagedObjectContext(MagicalSaves) MR_saveWithErrorCallback: -> Saving : * DEFAULT Context MAIN THREAD *
2012-10-16 17:05:20.121 OrderSystem[4523:c07] -NSManagedObjectContext(MagicalRecord) contextWillSave: Context : * DEFAULT Context MAIN THREAD * is about to save. Obtaining permanent IDs for new 1 inserted objects
2012-10-16 17:05:20.142 OrderSystem[4523:1303] -NSManagedObjectContext(MagicalSaves) MR_saveWithErrorCallback: -> Saving : * BACKGROUND SAVE * Context
2012-10-16 17:05:20.142 OrderSystem[4523:1303] -NSManagedObjectContext(MagicalRecord) contextWillSave: Context : * BACKGROUND SAVE * Context is about to save. Obtaining permanent IDs for new 1 inserted objects
When I check my stored data entity using findAll, it does seem to be stored in the database. And if I close the application completely, and relaunch the application, the entity is still there (which suggest the entity had been stored persistently, and not just in the memory). So it seems like everything is working, but any idea what are those error messages? and is there any way to turn them off? or solve them? because it's blocking my other NSLog...
Thank you
Upvotes: 12
Views: 6624
Reputation: 798
swift
MagicalRecord.setLoggingLevel(MagicalRecordLoggingLevel.Off)
objC
[MagicalRecord setLoggingLevel:MagicalRecordLogLevelOff];
put it in your AppDelegate when the application didFinishLaunchingWithOptions
Upvotes: 6
Reputation: 3233
In case you use pods add preprocessor macro
MR_ENABLE_ACTIVE_RECORD_LOGGING=0
to magical record project like this:
Upvotes: 20
Reputation: 3907
found it. add #define MR_ENABLE_ACTIVE_RECORD_LOGGING 0
in your Prefix.pch file before #import "CoreData+MagicalRecord.h"
Upvotes: 31
Reputation: 69687
It looks like you still have errors to fix. I suggest not ignoring those during development...
Upvotes: 3