{"action":"created","issue":{"url":"https://api.github.com/repos/jessesquires/JSQDataSourcesKit/issues/40","labels_url":"https://api.github.com/repos/jessesquires/JSQDataSourcesKit/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/jessesquires/JSQDataSourcesKit/issues/40/comments","events_url":"https://api.github.com/repos/jessesquires/JSQDataSourcesKit/issues/40/events","html_url":"https://github.com/jessesquires/JSQDataSourcesKit/issues/40","id":118608437,"number":40,"title":"NSFetchRequest with fetchLimit causes crash","user":{"login":"f1nality","id":1628232,"avatar_url":"https://avatars.githubusercontent.com/u/1628232?v=3","gravatar_id":"","url":"https://api.github.com/users/f1nality","html_url":"https://github.com/f1nality","followers_url":"https://api.github.com/users/f1nality/followers","following_url":"https://api.github.com/users/f1nality/following{/other_user}","gists_url":"https://api.github.com/users/f1nality/gists{/gist_id}","starred_url":"https://api.github.com/users/f1nality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f1nality/subscriptions","organizations_url":"https://api.github.com/users/f1nality/orgs","repos_url":"https://api.github.com/users/f1nality/repos","events_url":"https://api.github.com/users/f1nality/events{/privacy}","received_events_url":"https://api.github.com/users/f1nality/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jessesquires/JSQDataSourcesKit/labels/needs%20review","name":"needs review","color":"bfa78f"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-24T13:28:23Z","updated_at":"2015-11-25T05:57:00Z","closed_at":null,"body":"Hello,\r\nUsing NSFetchRequest with fetchLimit cases crash if objects are added to managed context. This happens because  `(self.fetchedResultsController.sections?[section])?.numberOfObjects ?? 0` (CollectionViewDataSourceProvider.swift line 236) returns more objects than `fetchLimit` is (discussed http://stackoverflow.com/questions/9022580/nsfetchedresultscontroller-ignores-fetchlimit-after-performfetch). So first of all collectionview begins to render more cells than `fetchLimit` and after another `performFetch` it crashes as dataSource tries to get section item with index > `fetchLimit`.\r\n\r\nAbility to override `bridgedDataSource`'s `numberOfItemsInSection` will fix this problem."},"comment":{"url":"https://api.github.com/repos/jessesquires/JSQDataSourcesKit/issues/comments/159499322","html_url":"https://github.com/jessesquires/JSQDataSourcesKit/issues/40#issuecomment-159499322","issue_url":"https://api.github.com/repos/jessesquires/JSQDataSourcesKit/issues/40","id":159499322,"user":{"login":"f1nality","id":1628232,"avatar_url":"https://avatars.githubusercontent.com/u/1628232?v=3","gravatar_id":"","url":"https://api.github.com/users/f1nality","html_url":"https://github.com/f1nality","followers_url":"https://api.github.com/users/f1nality/followers","following_url":"https://api.github.com/users/f1nality/following{/other_user}","gists_url":"https://api.github.com/users/f1nality/gists{/gist_id}","starred_url":"https://api.github.com/users/f1nality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f1nality/subscriptions","organizations_url":"https://api.github.com/users/f1nality/orgs","repos_url":"https://api.github.com/users/f1nality/repos","events_url":"https://api.github.com/users/f1nality/events{/privacy}","received_events_url":"https://api.github.com/users/f1nality/received_events","type":"User","site_admin":false},"created_at":"2015-11-25T05:57:00Z","updated_at":"2015-11-25T05:57:00Z","body":"Yes, i'll post it later"}}