From 86335ac260234192ec23a4ea256c464b118daad5 Mon Sep 17 00:00:00 2001 From: PhilCai Date: Wed, 18 Jan 2017 08:34:15 -0800 Subject: [PATCH] fix issue 424 Summary: - [x] All tests pass. Demo project builds and runs. - [x] I added tests, an experiment, or detailed why my change isn't tested. - [x] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes. - [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md) Closes https://github.com/Instagram/IGListKit/pull/426 Differential Revision: D4428853 Pulled By: rnystrom fbshipit-source-id: 1c5f3aa196a726986be291c7347eded853eb0eac --- CHANGELOG.md | 3 +++ Source/IGListStackedSectionController.m | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f95614b4..10206ede 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ This release closes the [2.2.0 milestone](https://github.com/Instagram/IGListKit - Fix bug where emptyView's hidden status is not updated after the number of items is changed with `insertInSectionController:atIndexes:` or related methods. [Peter Edmonston](https://github.com/edmonston) [(#395)](https://github.com/Instagram/IGListKit/pull/395) - Fix bug where `IGListStackedSectionController`'s children need to know `numberOrItems` before didUpdate is called. [(#348)](https://github.com/Instagram/IGListKit/pull/390) +- Fix bug where `-[UICollectionViewCell ig_setStackedSectionControllerIndex:]` should use `OBJC_ASSOCIATION_COPY_NONATOMIC` for NSNumber. [PhilCai](https://github.com/PhilCai1993) [(#424)](https://github.com/Instagram/IGListKit/pull/426) 2.1.0 ----- @@ -178,3 +179,5 @@ You can find a [migration guide here](https://instagram.github.io/IGListKit/migr ----- Initial release. :tada: + + diff --git a/Source/IGListStackedSectionController.m b/Source/IGListStackedSectionController.m index 0d590b43..1496998f 100644 --- a/Source/IGListStackedSectionController.m +++ b/Source/IGListStackedSectionController.m @@ -33,7 +33,7 @@ static void * kStackedSectionControllerKey = &kStackedSectionControllerKey; static void * kStackedSectionControllerIndexKey = &kStackedSectionControllerIndexKey; - (void)ig_setStackedSectionControllerIndex:(NSInteger)stackedSectionControllerIndex { - objc_setAssociatedObject(self, kStackedSectionControllerIndexKey, @(stackedSectionControllerIndex), OBJC_ASSOCIATION_ASSIGN); + objc_setAssociatedObject(self, kStackedSectionControllerIndexKey, @(stackedSectionControllerIndex), OBJC_ASSOCIATION_COPY_NONATOMIC); } - (NSInteger)ig_stackedSectionControllerIndex {