PrettyKit icon indicating copy to clipboard operation
PrettyKit copied to clipboard

ARC Support

Open ryanolson opened this issue 12 years ago • 4 comments

Adds ARC support

ryanolson avatar Jul 26 '12 11:07 ryanolson

Cool! I'm not sure yet of when adding that, though. As I have already published a version without ARC, I'm not sure of how to bring ARC support.

Shall I switch to ARC and break compatibility with non-ARC projects that are currently using the lib? Or shall I detect if ARC is enabled or not, and manage memory manually in the latter case? Anyway, your patch just removes explicit memory management, so detecting ARC support would need an extra effort.

vicpenap avatar Jul 31 '12 18:07 vicpenap

You could release two versions of the library. An ARC version and a non-ARC version. Similar to how SDWebImage does.

thomasconner avatar Sep 08 '12 19:09 thomasconner

I would like to use this library but my project currently uses ARC also. Maybe using something like the following would allow you to support both version in one library.

 #if __has_feature(objc_arc)
     // has ARC
 #else
    // doesnt have ARC
 #endif

thomasconner avatar Sep 08 '12 19:09 thomasconner

Yes, that's one alternative. The other one is supporting only ARC. I will probably choose the latter.

However, you can use PrettyKit in the meanwhile, if you import It through CocoaPods. CocoaPods will manage ARC and non-ARC code automagically :)

No dia 08/09/2012, às 21:16, Thomas Conner [email protected] escreveu:

I would like to use this library but my project currently uses ARC also. Maybe using something like the following would allow you to support both version in one library.

#if __has_feature(objc_arc) // has ARC #else // doesnt have ARC #endif

— Reply to this email directly or view it on GitHubhttps://github.com/vicpenap/PrettyKit/pull/23#issuecomment-8396853.

vicpenap avatar Sep 08 '12 19:09 vicpenap