magicalrecord

CoreData - multiple persistent stores [closed]

☆樱花仙子☆ 提交于 2019-12-06 02:10:23
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . I need some help understanding CoreData. Let's say I have MagicalRecords and RestKit installed, and I also have a server, which can return me some posts . Then I need to save some of those posts onto device memory, so a user can read the post later on (even with no internet

Coredata crash while fetching

我只是一个虾纸丫 提交于 2019-12-05 23:19:44
问题 I am getting some weird coredata error in the production app and I was able to get hold of the Crash Report. Its Crashing with the following message at times *** error for object 0x17e400000: Freeing unallocated pointer *** error for object 0x17fd03730: pointer being reallocated was not allocated And here is the stack trace Crashed: SQLQueue 0x13ff15250 for datastore.sqlite SIGABRT ABORT 0x0000000183986014 0 libsystem_kernel.dylib __pthread_kill + 8 1 libsystem_pthread.dylib pthread_kill +

Magical Record add object, different context error

↘锁芯ラ 提交于 2019-12-05 21:47:31
I'm using Magical Record in my app, and want to add the functionality for a user to add a 'Note', which is a child of 'entry'. I added this code: [MagicalRecord saveWithBlock: ^(NSManagedObjectContext *localContext) { Note *newNote = [Note MR_createInContext: localContext]; newNote.content = noteContent; newNote.name = @"User Note"; [self.entry addNotesObject: newNote]; } completion: ^(BOOL success, NSError *error) { if (error != nil) { // show alert } else if (success) { [[self tableView] reloadData]; } }]; The error I keep getting on the last line is "Illegal attempt to establish a

MR_SHORTHAND does not work

好久不见. 提交于 2019-12-05 11:28:13
I use MagicalRecords but by some reason MR_SHORTHAND does not work for me. I have added these lines below to Prefix.pch #define MR_SHORTHAND #import "CoreData+MagicalRecord.h" In case when app calls + createEntity method the app terminates due unrecognized selector. But if I write MR_createEntity everything works fine. Team *team = [Team MR_createEntity]; // This line works but Team *team = [Team createEntity]; // This line does not work with reason: '+[Team createEntity]: unrecognized selector sent to class 0x74b8c' I know we haven't announced it publicly prior to this answer, but we've

iCloud Time out. (using iCloud + Core Data + Magical Record

别等时光非礼了梦想. 提交于 2019-12-05 03:58:15
I started an app test to use Core Data and iCloud (using Magical Records). After a lot of troubles to configure Provisioning Profiles and Entitlements, the app finally runs. After a while the app crash and throw this message:: 2012-12-31 03:42:07.079 iCloudTest[252:1103] -[PFUbiquitySafeSaveFile waitForFileToUpload:](268): CoreData: Ubiquity: <PFUbiquityPeerReceipt: 0x1cd5a420>(0) permanentLocation: <PFUbiquityLocation: 0x1cd57b30>: /private/var/mobile/Library/Mobile Documents/MA5BADG5AW~com~gazapps~iCloudTest/mobile.4088E03C-763E-5A81-BB1B-64CABAFA73E3/com.gazapps.iCloudTest

How do I set up Core Data lightweight migration using MagicalRecord?

余生长醉 提交于 2019-12-04 23:08:16
问题 I have hit a brick wall trying to setup lightweight migration of Core Data using MagicalRecord. I have looked at all of the posts on this subject, using Google and SO. I understand how the persistentStoreCoordinator works and what the settings I am trying to make also do. Here's my code: AppDeligate.h NSPersistentStoreCoordinator *persistentStoreCoordinator; AppDelegate.m - (NSPersistentStoreCoordinator *)persistentStoreCoordinator { if (persistentStoreCoordinator != nil) { return

Magical Record not saving

可紊 提交于 2019-12-04 21:26:20
问题 I am using Magical Record: https://github.com/magicalpanda/MagicalRecord I am trying to save records that I get the from my website to the sqllite database using Magical Record and Core Data, but I keep getting the error: MR_saveWithErrorCallback:](0xaaa6bd0) NO CHANGES IN CONTEXT <NSManagedObjectContext (0xaaa6bd0): *** BACKGROUND SAVING (ROOT) ***> on *** BACKGROUND THREAD *** - NOT SAVING Here is the code: for(int i = 0; i < count; i += 1) { // results = array of all services from site

Can't Find iPhone Simulator's SQLite Database : Using Magical Record

纵饮孤独 提交于 2019-12-04 19:10:25
In my application's documents folder, I do not find my SQLite database Library/Application Support/iPhone Simulator/6.1/"random app id"/Documents/ ^This folder is empty MagicalRecord seems to be working, I just have no idea how to find the database. I use the following to set up Magical Record [MagicalRecord setupAutoMigratingCoreDataStack]; So where does MagicalRecord store its database? MagicalRecord stores, by default, all data stores in the following location: {App Folder}/Library/Application Support/{App Name from Info.plist}/{storeName.sqlite} This is easily accessible from the simulator

NSFetchedResultsController feeding table view while background update of same persistent store causes deadlock

蓝咒 提交于 2019-12-04 14:43:54
Still working on converting an app over from downloading information every time it uses or displays it, to caching it on-phone using CoreData (courtesy of MagicalRecord). This is on iOS 7 Because we don't have a data-push system set up to automatically update the phone's cached data whenever some data changes on the backend, I've been thinking over the last many months (as we worked on other aspects of the app) how to manage keeping a local copy of the data on the phone and being able to have the most up to date data in the cache. I realized that as long as I still fetch the data every time :-

Using an existing SQLite database in MagicalRecord

橙三吉。 提交于 2019-12-04 14:01:02
I've created a SQLite database that contains records from some JSON using this tutorial , and I want to use MagicalRecord to query it. MagicalRecord sees the NSManagedObject ( BlogPost ) and can create records, but it doesn't see the prepopulated records, so I'm guessing it's not seeing the SQLite file I've added. I've verified that the SQLite database does indeed contain rows using a SQLite client. In application:didFinishLaunchingWithOptions: , I've put: [MagicalRecord setupCoreDataStackWithStoreNamed:@"DBG.sqlite"]; And in applicationWillTerminate: : [MagicalRecord cleanUp]; When I call