¡@

Home 

2014/10/15 ¤U¤È 10:07:07

iphone Programming Glossary: displayorder

How can I maintain display order in UITableView using Core Data?

http://stackoverflow.com/questions/1648223/how-can-i-maintain-display-order-in-uitableview-using-core-data

I'm really hoping I'm missing something. I have a single Core Data entity that has an int16 attribute on it called displayOrder . I use an NSFetchRequest that has been sorted on displayOrder to return the data for my UITableView. Everything but reordering.. Data entity that has an int16 attribute on it called displayOrder . I use an NSFetchRequest that has been sorted on displayOrder to return the data for my UITableView. Everything but reordering is being respected. Here is my inefficient moveRowAtIndePath.. FFObject affectedObject self.fetchedResultsController.fetchedObjects objectAtIndex fromIndex affectedObject.displayOrderValue toIndex self FF_fetchResults for NSUInteger i 0 i self.fetchedResultsController.fetchedObjects count i FFObject otherObject..

UITableView Core Data reordering

http://stackoverflow.com/questions/2360938/uitableview-core-data-reordering

as to how to implement reordering with a UITableView in a Core Data project. What I know is that I need to have a displayOrder attribute in my Entity to track the order of items and I need to enumerate through all the objects in the fetched results.. to track the order of items and I need to enumerate through all the objects in the fetched results and set their displayOrder attribute. In the given code in the question I linked to the table view delegate method calls a method like this self FF_fetchResults.. I'm not sure which part you are having trouble with based on the comments ... but here is my suggestion. The displayOrder is just a simple attribute on a NSManagedObject class. If you can save a managed object then you will be able finish this..

Call to a number, which contain #. (IPhone SDK)

http://stackoverflow.com/questions/3554605/call-to-a-number-which-contain-iphone-sdk

Arbitrary Attributes in Core Data

http://stackoverflow.com/questions/3561936/arbitrary-attributes-in-core-data

the other stores and trivial in SQL itself. The only technique I can find is to sort the entries myself then write a displayOrder attribute back to the store and have Core Data sort by the displayOrder . I do that with the following class method on Entry.. is to sort the entries myself then write a displayOrder attribute back to the store and have Core Data sort by the displayOrder . I do that with the following class method on Entry . This uses a some methods and global functions not shown but hopefully.. context context int i di if ascending i 0 di 1 else i sortedEntries count di 1 for Entry e in sortedEntries e.displayOrder NSNumber numberWithInteger i i di saveMOC moc @end This has two major problems It's slow even with small data sets. It can..