Availability check
Closed this issue · 0 comments
JoostK commented
There is a problem with the current availability check. In UIImage+Tint.m
the current code is:
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 4.0) {
UIGraphicsBeginImageContextWithOptions([self size], NO, 0.0); // 0.0 for scale means "scale for device's main screen".
}
#else
if ([[[UIDevice currentDevice] systemVersion] floatValue] < 4.0) {
UIGraphicsBeginImageContext([self size]);
}
#endif
However, imagine you compile against iOS 4.0, so __IPHONE_OS_VERSION_MAX_ALLOWED
will be 40000
, thus only
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 4.0) {
UIGraphicsBeginImageContextWithOptions([self size], NO, 0.0); // 0.0 for scale means "scale for device's main screen".
}
will get compiled. Now run the app in iOS prior to 4.0 and no context will get created, since the if-statement will return NO
. Vice versa is the same of course, compiled against 3.x.x and run in iOS 4.x.x will not work.
I have a fork already available at http://github.com/JoostK/MGImageUtilities which fixes the problem.