core-data

RestKit 0.2x simultaneous RKManagedObjectRequestOperation

ε祈祈猫儿з 提交于 2020-01-25 11:32:31
问题 In RestKit 0.10.3 using delegate methods I was able to send simultaneous GET requests, even if mapping of each one was executed sequentially. I have GET requests which need so much time to receive a response, so I would like to send all requests simultaneously but respect an order in mapping (I have relationships crossing the three requests). What I need: 1) send GET request n. 1, send GET request n. 2, send GET request n. 3 2) start mapping of request 1 as soon as response 1 is received 3)

RestKit 0.2x simultaneous RKManagedObjectRequestOperation

吃可爱长大的小学妹 提交于 2020-01-25 11:32:07
问题 In RestKit 0.10.3 using delegate methods I was able to send simultaneous GET requests, even if mapping of each one was executed sequentially. I have GET requests which need so much time to receive a response, so I would like to send all requests simultaneously but respect an order in mapping (I have relationships crossing the three requests). What I need: 1) send GET request n. 1, send GET request n. 2, send GET request n. 3 2) start mapping of request 1 as soon as response 1 is received 3)

Weird Errors using CoreData with iCloud

 ̄綄美尐妖づ 提交于 2020-01-25 11:29:11
问题 I used the sample code from the new CoreData Recipes project (iPhoneCoreDataRecipes Sample Code) to build in iCloud syncing in an existing iOS application which uses a CoreData SQLite "Database" in combination with a very complex data model with lots of many-too-many-relationships (Maybe this is part of the cause of my problem or at least a hint). Before that the application worked fine without any warnings regarding the database. But now the debugger goes crazy with errors like this when I

Getting a String value from NSOrderedSet using SwiftUI ForEach

独自空忆成欢 提交于 2020-01-25 08:34:11
问题 Using this question/answer I am able to use ForEach to use a NSOrderedSet created from a One to Many relationship in CoreData, however I can't seem to access a String Attribute stored in the Core Data entity. I have two CoreData entities: Client & SessionNote. Clients can have many SessionNotes, the NSOrderedSet of clientNotes, and SessionNote can only have one Client. Client+CoreDataClass.swift: public class Client: NSManagedObject { } Client+CoreDataProperties.swift: extension Client {

CoreData: numberOfObjects in Section incorrect

帅比萌擦擦* 提交于 2020-01-24 20:28:06
问题 I'm using CoreData in an iOS app to save a simple list of location objects (name, coordinates). I've run into a situation twice now, after a memory warning, when the CoreData records appear to become corrupt. Specifically, (in tableView:numberOfRowsInSection:) NSUInteger numObjects = [[[fetchedResultsController sections] objectAtIndex:section] numberOfObjects]; returns 4 for section == 0. Then (in tableView:cellForRowAtIndexPath:) aLocation = [fetchedResultsController objectAtIndexPath

Core Data / NSFetchedResultsController - Registering changed objects related to the fetched object

ⅰ亾dé卋堺 提交于 2020-01-24 19:43:05
问题 I use a NSFetchedResultsController to get a list of objects which is displayed in a UITableView . If I change values in the objects the whole thing triggers and automatically reloads the changed rows. But one of the displayed values comes from related objects (one-to many relationship). Those objects have a transient title (so it's value comes again from another object). When this title changes the rows are not reloaded. Question: Can anybody suggest a clean solution to this? Possible Dirty

Is it possible to use core data (Xcode 8 and Swift 3.0) with both iOS 9 and 10 ?

巧了我就是萌 提交于 2020-01-24 12:48:33
问题 I want start new app in Swift 3 Xcode 8 and support iOS 8.4/9.x How to deal with Core Data ? 回答1: Yes, it is easily possible. Swift 3 is targeted to run on iOS v8+. You will only be able to use the subset of APIs supported on iOS v8.4 though. The best way to find out the answer to your question though is to create a test project that uses Core Data. You'll find that NSPersistentContainer creates an error. Why? It isn't available on the earlier OSes. Alternatively, create a test project with

Working with fetched request sort descriptors

北城余情 提交于 2020-01-24 12:33:30
问题 I have problem with my sort descriptor. I am fetching a ranking of a football club. This is how my webservice gives the data back. "ranking": [ { "type": "competitie", "position": "1", "name": "Club Brugge", "gamesPlayed": "10", "gamesWon": "6", "gamesTied": "4", "gamesLost": "0", "goalsPos": "25", "goalsNeg": "12", "goalsDiff": 13, "points": "22" } Here is my fetch request. - (void)getKlassement // attaches an NSFetchRequest to this UITableViewController { NSFetchRequest *request =

Working with fetched request sort descriptors

那年仲夏 提交于 2020-01-24 12:32:57
问题 I have problem with my sort descriptor. I am fetching a ranking of a football club. This is how my webservice gives the data back. "ranking": [ { "type": "competitie", "position": "1", "name": "Club Brugge", "gamesPlayed": "10", "gamesWon": "6", "gamesTied": "4", "gamesLost": "0", "goalsPos": "25", "goalsNeg": "12", "goalsDiff": 13, "points": "22" } Here is my fetch request. - (void)getKlassement // attaches an NSFetchRequest to this UITableViewController { NSFetchRequest *request =

Core Data & UIManagedDocument in Xcode 4.3: Can't merge models

本秂侑毒 提交于 2020-01-24 12:05:48
问题 I'd like to thank all the people that contribute to this website. I am one h*ll of a noob at programming and you all help me out so much. With that said, let's get on with my latest problem! I am creating an app that uses a UIManagedDocument to store a Core Data model for me. I use to create the UIManagedDocument with the following code, but now with Xcode 4.3.2 (The one that updates with the Mac App Store) I have an issue. Here's the code: NSURL *url = [[[NSFileManager defaultManager]