{"id":22112398,"url":"https://github.com/lukeredpath/lrfetchedresultset","last_synced_at":"2025-07-25T07:32:56.137Z","repository":{"id":5879207,"uuid":"7096850","full_name":"lukeredpath/LRFetchedResultSet","owner":"lukeredpath","description":null,"archived":false,"fork":false,"pushed_at":"2014-07-09T19:41:07.000Z","size":167,"stargazers_count":21,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2023-04-09T05:47:27.435Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lukeredpath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-10T16:47:34.000Z","updated_at":"2019-06-16T10:41:41.000Z","dependencies_parsed_at":"2022-09-05T15:41:15.349Z","dependency_job_id":null,"html_url":"https://github.com/lukeredpath/LRFetchedResultSet","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeredpath%2FLRFetchedResultSet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeredpath%2FLRFetchedResultSet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeredpath%2FLRFetchedResultSet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeredpath%2FLRFetchedResultSet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukeredpath","download_url":"https://codeload.github.com/lukeredpath/LRFetchedResultSet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227544094,"owners_count":17785198,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-01T10:57:50.087Z","updated_at":"2024-12-01T10:57:50.168Z","avatar_url":"https://github.com/lukeredpath.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LRFetchedResultSet - auto-updating Core Data fetch results\n\nLast night, I tweeted this:\n\n\u003cblockquote class=\"twitter-tweet\"\u003e\u003cp\u003eWouldn’t it be nice if instead of returning an array of objects from a fetch, Core Data returned some kind of auto updating fetch result?\u003c/p\u003e\u0026mdash; Luke Redpath (@lukeredpath) \u003ca href=\"https://twitter.com/lukeredpath/status/277934596811804673\" data-datetime=\"2012-12-10T00:35:46+00:00\"\u003eDecember 10, 2012\u003c/a\u003e\u003c/blockquote\u003e\n\u003cscript src=\"//platform.twitter.com/widgets.js\" charset=\"utf-8\"\u003e\u003c/script\u003e\n\nThis is my attempt to satisfy that need.\n\n## Getting started\n\nThere's nothing fancy here - you'll want to clone the submodules so you can run the tests. It's just one file at the moment.\n\nA category on `NSManagedObjectContext` provides the `LR_executeFetchRequestAndReturnResultSet:error:`, which executes the fetch request and returns the resulting objects wrapped in an instance of `LRFetchedResultSet`. See the header file for more information.\n\nYou can observe changes to the result set by setting a change block. Changes will only be observed if this block is set.\n\n```objc\nNSFetchRequest *request = ...;\n\nLRFetchedResultSet *results = [self.managedObjectContext LR_executeFetchRequestAndReturnResultSet:request error:nil];\n\nif (results == nil) {\n  // handle error\n}\nelse {\n  [results notifyChangesUsingBlock:^(NSDictionary *changes) {\n    // changes contains inserted, updated and deleted objects\n  }];\n}\n```\n\n## Isn't this the same thing as NSFetchedResultsController?\n\nSort of - but not quite. For a start, NSFetchedResultsController is only available on iOS and it is specifically designed to work with UITableView data sources. It speaks in the domain of rows and sections, whereas this is more generic. You get your results, you can observe any changes to those results.\n\n## License\n\nAll code is licensed under the MIT license. See the LICENSE file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeredpath%2Flrfetchedresultset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukeredpath%2Flrfetchedresultset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeredpath%2Flrfetchedresultset/lists"}