coredata

CoreData and RestKit performance while importing very large datasets

匿名 (未验证) 提交于 2019-12-03 03:02:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using RestKit for fetching JSON data on various endpoints (on iOS platform). There are several questions on SO which point to the same direction like that one: Importing large datasets on iPhone using CoreData But my question is still a different one, because I know, if the JSON file gets too large, I have to cut it into chunks. I'll do that! How exactly is the importing done with CoreData in RestKit. Seems that there is a parent/child contexts setup, which is very inefficient when importing large datasets in the shortest possible

CoreData: error: Serious application error. Exception was caught during Core Data change processing

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Hi I'm getting crash, when i'm trying to insert 1000 records into db in back ground, i'm getting following exception: CoreData: error: Serious application error . Exception was caught during Core Data change processing. This is usually a bug within an observer of NSManagedObjectContextObjectsDidChangeNotification. -[__NSCFSet addObject:]: attempt to insert nil with userInfo (null)2013-11-19 09:41:19.587 3pTalk[7487:907] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFSet addObject:]: attempt to insert

CoreData: Failed to load optimized model at path

匿名 (未验证) 提交于 2019-12-03 02:51:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am getting this warning multiple times when i goto a view using google maps.This started as soon as i migrated to swift 2.0 and xcode 7 for my exising project .Im using google maps in my project. See the console log below I have gone through some links but was not helpful https://code.google.com/p/gmaps-api-issues/issues/detail?id=8459 https://forums.developer.apple.com/thread/14157 回答1: As indicated in your console log, this is caused by an issue in the Google Maps SDK. The issue has been fixed in the latest Google Maps SDK release, so if

iOS crash 'NSInternalInconsistencyException', reason: 'statement is still active' Core Data cache related?

匿名 (未验证) 提交于 2019-12-03 02:50:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Very occasionally seeing these pop up in crash reports on screens using NSFetchedResultsController , and not sure how to address them. I don't believe I'm using threading anywhere, unless NSFetchedResults is using them internally. 'NSInternalInconsistencyException', reason: 'statement is still active' is the full explanation I get. Two recent stack traces: 0 CoreFoundation 0x37a368bf __exceptionPreprocess + 163 1 libobjc.A.dylib 0x3151c1e5 objc_exception_throw + 33 2 CoreData 0x340b2ea5 -[NSSQLiteStatement cachedSQLiteStatement] + 1 3

CoreData issue: -[NSManagedObject setValue:]: unrecognized selector sent to instance

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I just started with CoreData yesterday, and I'm going crazy :( I created a project that uses CoreData (ticked the box -use CoreData). Created the entities, and then created the NSManagedObject classes for all the entities (I suppose they create the 'setter' and 'getter' methods for the entities). Now, I #imported all these classes in my AppDeletegate and wrote this in my applicationDidFinishLaunching method: (Subscriptions is one of the Entities in the application) NSManagedObjectContext *context = [self managedObjectContext]; Subscriptions

Error : CoreData: error: Failed to call designated initializer on NSManagedObject class 'Product'

匿名 (未验证) 提交于 2019-12-03 02:26:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I start to use core data with ios 5. I have my product model : Product.m : #import "Product.h" @implementation Product @dynamic category_id; @dynamic label; @dynamic price; @end Product.h : #import <Foundation/Foundation.h> #import <CoreData/CoreData.h> @interface Product : NSManagedObject @property (nonatomic, retain) NSString *category_id; @property (nonatomic, retain) NSString *label; @property (nonatomic, retain) NSString *price; @end I try to parse an xml with a custom class using NSXMLParserDelegate. My xml looks like : <section id="2"

How to force coredata to rebuild sqlite database model?

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In my app I sometimes need to rebuild and repopulate database file. SQLite databse is created and managed by CoreData stack. What I'm trying to do is drop the file and then simply recreate persistentStoreCoordinator object. It works under simulator but not on device, where I'm getting such an error: NSFilePath = "/var/mobile/Applications/936C6CC7-423A-46F4-ADC0-7184EAB0CADD/Documents/MYDB.sqlite"; NSUnderlyingException = I/O error for database at /var/mobile/Applications/936C6CC7-423A-46F4-ADC0-7184EAB0CADD/Documents/MYDB.sqlite. SQLite

Saving CoreData to-many relationships in Swift

匿名 (未验证) 提交于 2019-12-03 02:13:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a one-to-many relationship that looks like so, I've set up my model classes in a file to match: import CoreData import Foundation class Board: NSManagedObject { @NSManaged var boardColor: String @NSManaged var boardCustomBackground: AnyObject? @NSManaged var boardID: String @NSManaged var boardName: String @NSManaged var lists: NSSet } class List: NSManagedObject { @NSManaged var listID: String @NSManaged var listName: String @NSManaged var board: Board } Because I'm fetching data from multiple JSON endpoints, I have to save my lists

Xcode generated CoreData files cannot be processed by Copy Bundle Resources build phase

匿名 (未验证) 提交于 2019-12-03 01:39:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I added CoreData to my app MY_APP : I defined the data model by creating a xcdatamodeld file containing a single entity XXX with a few attributes. Using Xcode/Editor/Create NSManagedSubclass, Xcode created 2 files, XXX+CoreDataClass.swift and XXX+CoreDataProperties.swift . I wrote a little code to test storage and fetch back from core data, and everything works fine. The problem: At the beginning of the build phase, I get 3 warnings: These 3 files are not listed under MY_APP target/Build Phases/Copy Bundle Resources. My questions:

NSPredicate BETWEEN with NSDate causes -[__NSDate constantValue]: unrecognized selector sent to instance 0x1e7ff0

匿名 (未验证) 提交于 2019-12-03 01:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to fetch from Core Data records that have a startTime between two dates. Here's my code: NSDate *today = [NSDate date]; NSDate *distantFuture = [NSDate distantFuture]; // Create the predicate NSPredicate *predicate = [NSPredicate predicateWithFormat:@"startTime BETWEEN %@", [NSArray arrayWithObjects:today, distantFuture, nil]]; NSLog(@"today: %@, distantFuture: %@", today, distantFuture); NSLog(@"predicate: %@", predicate); // Add the predicate to the fetchRequest [[[self fetchedResultsController] fetchRequest] setPredicate