Rightpoint / RZCellSizeManager

Dynamic size computation and caching for cells.
MIT License
242 stars 32 forks source link

Create an empty non-temporary dictionary for cell configurations #17

Closed jandillmann closed 10 years ago

jandillmann commented 10 years ago

Fix for #14

[NSMutableDictionary dictionary] creates a temporary dictionary, which gets autoreleased too early and leads to crashes. [[NSMutableDictionary alloc] init] prevents this.

ndonald2 commented 10 years ago

@jandillmann Thanks for the pull request, but under ARC, all of the dictionary instantiations behave the same way when assigned to a strong property (or in this case, an strong ivar backing a strong property). Consider that if your assessment were true, the dictionary would be autoreleased immediately after init, so nothing would ever work correctly.

I think the issue is that the podspec does not specify that this component requires ARC, which it definitely does. Your example project does not build the pod with ARC enabled, but switching it on fixes the issue. I will open another issue to fix this.

Thanks for letting us know about this!