arashpayan / appirater

A utility that reminds your iPhone app's users to review the app.

Home Page:http://arashpayan.com/blog/2009/09/07/presenting-appirater/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

no longer compiles for iOS 4.x

spollack opened this issue · comments

The recent addition of the delegate notion includes a property annotated "weak", which won't compile for iOS4.x targets. We need to change this to unsafe_unretained for platforms before iOS5.

i.e. change

@Property(nonatomic, weak) NSObject *delegate;

to

@Property(nonatomic, unsafe_unretained) NSObject *delegate;

Indeed, weak isn't supported in iOS < 5. Weak is good, though, so we should use it whenever possible. I'd recommend something like:

#if __has_feature(objc_arc_weak)
@Property(nonatomic, weak) NSObject *delegate;
#else
@Property(nonatomic, unsafe_unretained) NSObject *delegate;
#endif

Can you make a pull request with this change? I'll merge it quickly.

Thanks,
Arash
On Oct 26, 2012 9:19 AM, "fernandonf" notifications@github.com wrote:

Indeed, weak isn't supported in iOS < 5. Weak is good, though, so we
should use it whenever possible. I'd recommend something like:

#if __has_feature(objc_arc_weak)
@Property https://github.com/property(nonatomic, weak) NSObject
*delegate;
#else
@Property https://github.com/property(nonatomic, unsafe_unretained)
NSObject *delegate;
#endif


Reply to this email directly or view it on GitHubhttps://github.com//issues/72#issuecomment-9818318.

Actually, it still doesn't work. There is a typo. Should be unsafe_unretained not unsafe_unreferenced

https://github.com/arashpayan/appirater/blob/master/Appirater.h#L96

or you can use PLWeakCompatibility to support weak on iOS 4