Skip to content

Make Sparrow compatible with ARC #1040

PrimaryFeather opened this Issue Aug 1, 2011 · 5 comments

3 participants


ARC = Automatic Reference Counting, introduced in iOS 5.
Currently, a struct used by the SPPoolObject does not comply with ARC.

requnix commented Nov 4, 2011

For what it's worth I'd also like Sparrow to be ARC compatible. Not sure how much of a nightmare it is to change that struct though. I think you can replace it with a untyped pointer and do a little pointer manipulation wherever it gets used.


I also think it should be possible to do it that way! I'll report my progress here.


I changed,

//typedef struct
Class poolClass;
SPPoolObject *lastElement;

} SPPoolInfo;

on SPPoolObject.h to compile on ios 5 to supply ARC.
Did you make any improvements for ARC?


Sorry, I haven't found the time yet to look at it! In any case, I recommend you make a few tests with that change, to see if the pool works as expected. (E.g. by adding NSLogs into the SPObjectPool class, then creating a few SPPoints, releasing them, and creating them again - to see if they are correctly recycled.)


So, after all this time, I'm finally back and working on the next update -- and thus, finally fixed the ARC issue: you can now use Sparrow with ARC projects.

The fix was rather simply, actually; similar to what omeryavuz tried, I exchanged the struct with a normal Objective-c class. That did the trick.

Here's the corresponding commit: 771f623

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.