Skip to content

Commit 161ea6a

Browse files
committed
Conditionally compile RKDotNetDateFormatter.h for iOS > 4.0 and OS X > 10.6. fixes RestKit#378, refs RestKit#568
1 parent bf1b8c5 commit 161ea6a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Code/Support/RKDotNetDateFormatter.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
#import <Foundation/Foundation.h>
1010

11+
// NSRegularExpression not available until OS X 10.7 and iOS 4.0 (NS_CLASS_AVAILABLE(10_7, 4_0))
12+
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 || __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000
13+
1114
/**
1215
A subclass of NSDateFormatter that serves as translator between ASP.NET date serializations in JSON
1316
strings and NSDate objects. This is useful for properly mapping these dates from an ASP.NET driven backend.
@@ -76,3 +79,5 @@
7679
*/
7780
- (NSString *)stringFromDate:(NSDate *)date;
7881
@end
82+
83+
#endif

Code/Support/RKDotNetDateFormatter.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#import "RKDotNetDateFormatter.h"
1010
#import "RestKit.h"
1111

12+
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 || __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000
13+
1214
BOOL isValidRange(NSRange rangeOfMatch);
1315
NSTimeInterval secondsFromMilliseconds(NSTimeInterval millisecs);
1416
NSTimeInterval millisecondsFromSeconds(NSTimeInterval seconds);
@@ -101,3 +103,4 @@ NSTimeInterval millisecondsFromSeconds(NSTimeInterval seconds) {
101103
return seconds * 1000.f;
102104
}
103105

106+
#endif

0 commit comments

Comments
 (0)