leah / PullToRefresh

A simple iPhone TableViewController for adding pull-to-refresh functionality.
http://blog.leahculver.com/2010/07/iphone-pull-to-refresh.html
MIT License
1.91k stars 252 forks source link

ARC support #22

Closed kalys closed 11 months ago

kalys commented 12 years ago

Hello.

Now the library doesn't support ARC. As far as I know there are 2 options to solve this.

The first is adding -fno-objc-arc compiler flag for PullRefreshTableViewController.m file in build phases tab of target configs (as described here).

The second solution doesn't need any steps for developers. I found it in ViewDeck library. Here you can find changes.

Pay attention to the next lines of code.

#ifndef __has_feature
#define __has_feature(x) 0
#endif
#ifndef __has_extension
#define __has_extension __has_feature // Compatibility with pre-3.0 compilers.
#endif

#if __has_feature(objc_arc) && __clang_major__ >= 3
#define II_ARC_ENABLED 1
#endif // __has_feature(objc_arc)

and

- (void)dealloc {
#if !II_ARC_ENABLED
    [refreshHeaderView release];
    [refreshLabel release];
    [refreshArrow release];
    [refreshSpinner release];
    [textPull release];
    [textRelease release];
    [textLoading release];
    [super dealloc];
#endif
}

So the question is which way is correct? And should I pull-request this changes?