Permalink
Browse files

Conditionally compile RKDotNetDateFormatter.h for iOS > 4.0 and OS X …

…> 10.6. fixes #378, refs #568
  • Loading branch information...
blakewatters committed Feb 25, 2012
1 parent bf1b8c5 commit 161ea6aa95d6a02579c020899cc27926971b0d03
Showing with 8 additions and 0 deletions.
  1. +5 −0 Code/Support/RKDotNetDateFormatter.h
  2. +3 −0 Code/Support/RKDotNetDateFormatter.m
@@ -8,6 +8,9 @@
#import <Foundation/Foundation.h>
+// NSRegularExpression not available until OS X 10.7 and iOS 4.0 (NS_CLASS_AVAILABLE(10_7, 4_0))
+#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 || __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000
+
/**
A subclass of NSDateFormatter that serves as translator between ASP.NET date serializations in JSON
strings and NSDate objects. This is useful for properly mapping these dates from an ASP.NET driven backend.
@@ -76,3 +79,5 @@
*/
- (NSString *)stringFromDate:(NSDate *)date;
@end
+
+#endif
@@ -9,6 +9,8 @@
#import "RKDotNetDateFormatter.h"
#import "RestKit.h"
+#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 || __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000
+
BOOL isValidRange(NSRange rangeOfMatch);
NSTimeInterval secondsFromMilliseconds(NSTimeInterval millisecs);
NSTimeInterval millisecondsFromSeconds(NSTimeInterval seconds);
@@ -101,3 +103,4 @@ NSTimeInterval millisecondsFromSeconds(NSTimeInterval seconds) {
return seconds * 1000.f;
}
+#endif

0 comments on commit 161ea6a

Please sign in to comment.