English 中文(简体)
I Handle NSFet履历 海关成果观察代表最新情况
原标题:How do I Handle NSFetchedResultsControllerDelegate updates for custom results view

我目前正在着手开发一个基于核心数据库的仪表,以便绘制一份地图,说明将产生于。 NSFetResledultsController。 地图观点的理念是,地图将显示用户节省的一些地点。

利用国家扫盲基金会的优势之一 主计长是,我可以把我作为代表的地图观点定在国家不动产基金管理人的网站上,并获悉在另一个装置上或当用户被贴上标签时,对所节省的地点所作的任何改动。

I am currently having a bit of trouble getting my head around how to deal with a number of different kinds of updates that are sent to my NSFetchedResultsControllerDelegate implementation. The documentation: http://developer.apple.com/library/ios/#documentation/CoreData/Reference/NSFetchedResultsControllerDelegate_Protocol/Reference/Reference.html doesn t seem to tell you how these different updates should be handled as it seems more geared towards integrating with a UITableView, which does most of the work.

I am keeping an NSDictionary of my annotations that maps them to the NSIndexPath inside the result set. The issue is, for example, when I receive 10 move, 3 insert and 4 delete updates, what order should I process these in? Some of these indexPaths will have a number of conflicting indices and the order in which they are processed will have an affect on the actual annotations I need to move, insert or delete. If I perform all the move updates first, then the insert indices will cause the final order to be different to their final order if I inserted first.

有没有现有的小型图书馆/班级,这些图书馆/班级将在更新一套更新员额指数之前翻译一套指数。 如果不是的话,谁能解释这一 st子是如何发挥作用的,以便我能写自己的话?

Any help will be greatly appreciated!

问题回答

NSFetlate ResultsControler 一个更新周期的代表方法如下:

  • controllerWillChangeContent: (called once)
  • controller:didChangeObject:atIndexPath:forChangeType:newIndexPath: (called X times)
  • controllerDidChangeContent: (called once)

单单单向ChangeObject方法打电话,就是指一个目标/指数。 你们通过这些电话来接收这些电话的顺序应作修改。 这将保持连贯性。

如果你使用这些章节,你还可以要求控制:didChange Section:atIndex:forChangeType:与改用的电话相混合。





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签