nsfetchedresultscontroller

Core Data app crashing with “controllerWillChangeContent : unrecognized selector sent to instance”

丶灬走出姿态 提交于 2019-12-18 16:11:47
问题 I've got a core data app with 2 views. The first view lists "Rooms", the second lists "Scenes" in rooms. The Rooms page has an edit NavItem button, which when pressed enables an add NavItem button. You can delete and add rooms from here. Added rooms simply appear with a default "New Room" name in the table. The second view is a list of Scenes in the selected room. Same deal here, you can delete and add Scenes, and added Scenes simply appear in the table with the name "New Scene". Nothing

CoreData error driving me crazy… CoreData: Serious application error. An exception caught from delegate of NSFetchedResultsController

谁都会走 提交于 2019-12-18 10:55:26
问题 My application has two tab bars... Each takes the user to a tableviewcontroller that presents him with a list of items. The first view lets the user record entries in the database. The other tab/view reads from the database and presents those items to the user as well, however, no updates are made to the coreData/persistant store from this second view. When I add a new item via the first viewcontroller, it shows up perfectly in the view. However, as soon as I tap on the other tab bar to see

UISearchDisplayController animate reloadData

狂风中的少年 提交于 2019-12-18 09:12:21
问题 I've been reading all the documentation about UISearchDisplayController and its delegate but I can't find any way to animate the table view when the search criteria change. I'm using these two methods : They both return YES but still can't find any way to do something similar to : I don't know if it's important but I'm using an NSfetchedResultsController to populate the UITableView in the UISearchDisplayController That's it thanks ! 回答1: When the search string or scope has changed, you assign

iOS UITableView sections with fetchedResultsController confusion

风流意气都作罢 提交于 2019-12-18 04:10:57
问题 I have an entity being displayed in a table view in just one section. The entity has two attributes, workoutName and trainingLevel . Both are of string type. Training level consists of the 3 types: 1, 2, 3. (trainingLevel = (Integer 16 or String Type? Which would be ideal?) I would like to split the table into three sections, each section containing entries for the corresponding training level. How do I do this? The code I am currently using is below: - (NSInteger)numberOfSectionsInTableView:

How to switch UITableView's NSFetchedResultsController (or its predicate) programmatically?

两盒软妹~` 提交于 2019-12-17 18:11:10
问题 I have a UITableView that displays a subset of a large number of entities named "Documents". The subset is defined by another entity "Selection". Selections are named, ordered list of documents. It Works fine, except when I want to change the displayed selection at run time. I get only a blank list. Basically, I need to change the predicate that my NSFetchedResultsController holds so that the new predicate uses the another Selection. I couldn't make it work. My last attempt is to get rid of

NSFetchRequest and predicateWithBlock

眉间皱痕 提交于 2019-12-17 07:23:55
问题 I am playing with an app that uses Core Data and NSManagedObjects to populate a UITableView. There is only one class in my application, called Event . I have created the following custom instance method on Event : - (BOOL)isExpired { return ([[self.endOn dateAtEndOfDay] timeIntervalSinceNow] < 0); } I would like to limit the UITableView that displays Event objects to only the Events that are expired - that is, where isExpired returns YES . I have tried to do this by adding an NSPredicate to

NSFetchedResultsController with relationship not updating

你离开我真会死。 提交于 2019-12-17 04:01:23
问题 Let's say I have two entities, employee and department. A department has a to-many relationship with employee, many employees can be in each department but each employee only belongs to one department. I want to display all of the employees in a tableview sorted by data that is a property of the department they belong to using an NSFetchedResultsController. The problem is that I want my table to update when a department object receives changes just like it does if the regular properties of

Core data inserting rows and saving issue

倖福魔咒の 提交于 2019-12-14 03:59:39
问题 I´m having some problems when saving data in core data and also with the rows organization and for better understanding of what my problem is, i´m going to explain what i have: I have a main tableview working with dynamic rows, in this tableview i have a + button, whenever the + button is pressed, a tableview appears inside a popover were the user can choose the "type of cell" to insert in the main tableview. The "type of cell" are custom cells and they have they´re one class and xib file.

iOS FetchRequest on aggregate functions: How to include pending changes?

非 Y 不嫁゛ 提交于 2019-12-14 01:32:43
问题 I've finally at least narrowed down this problem. I'm computing some aggregate functions (as in this example the sum) of expenditures. If I change some expenditures, this aggregate fetch doesn't refresh immediately but only after a while (probably after the changes have been saved to the database). I've found this part in the doc: - (void)setIncludesPendingChanges:(BOOL)yesNo As per the documentation A value of YES is not supported in conjunction with the result type NSDictionaryResultType ,

Conversion from NSDate to NSString with Core-Data Migration on Attribute Not Displaying the String Appropriately

点点圈 提交于 2019-12-13 19:04:42
问题 I'm sorry for the long question; I have no idea how to explain this without including lots of code and images. I am working on updating my app and because I discovered an issue relating to dates, I had to change an Attribute from NSDate to NSString . I'm using Core Data for my application. The model of the application is: Transaction Entity Date Entity Years Entity The Year Entity has an attribute which is called yearOfEvent of type NSDate and with the update to my app (already in the app