Skip to content

Commit 53920a4

Browse files
committed
Replace all usages of TARGET_OS_IPHONE.
1 parent 003ea1c commit 53920a4

File tree

6 files changed

+17
-15
lines changed

6 files changed

+17
-15
lines changed

Parse/Internal/PFApplication.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ + (instancetype)currentApplication {
3535
///--------------------------------------
3636

3737
- (BOOL)isAppStoreEnvironment {
38-
#if TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR
38+
#if TARGET_OS_IOS && !TARGET_IPHONE_SIMULATOR
3939
return ([[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"] == nil);
4040
#endif
4141

Parse/Internal/PFDevice.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ - (NSString *)operatingSystemBuild {
133133

134134
- (BOOL)isJailbroken {
135135
BOOL jailbroken = NO;
136-
#if TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR
136+
#if TARGET_OS_IOS && !TARGET_IPHONE_SIMULATOR
137137
DIR *dir = opendir("/");
138138
if (dir != NULL) {
139139
jailbroken = YES;

Parse/Internal/PFFileManager.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
static NSString *const _PFFileManagerParseDirectoryName = @"Parse";
2020

2121
static NSDictionary *_PFFileManagerDefaultDirectoryFileAttributes() {
22-
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
22+
#if !PF_TARGET_OS_OSX
2323
return @{ NSFileProtectionKey : NSFileProtectionCompleteUntilFirstUserAuthentication };
2424
#else
2525
return nil;
@@ -28,7 +28,7 @@
2828

2929
static NSDataWritingOptions _PFFileManagerDefaultDataWritingOptions() {
3030
NSDataWritingOptions options = NSDataWritingAtomic;
31-
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
31+
#if !PF_TARGET_OS_OSX
3232
options |= NSDataWritingFileProtectionCompleteUntilFirstUserAuthentication;
3333
#endif
3434
return options;
@@ -92,7 +92,7 @@ + (BFTask *)createDirectoryIfNeededAsyncAtPath:(NSString *)path
9292
}
9393
}
9494

95-
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
95+
#if TARGET_OS_IOS || TARGET_OS_WATCH // No backups for Apple TV, since everything is cache.
9696
if (options & PFFileManagerOptionSkipBackup) {
9797
[self _skipBackupOnPath:path];
9898
}
@@ -271,7 +271,9 @@ - (NSString *)parseDefaultDataDirectoryPath {
271271
}
272272

273273
- (NSString *)parseLocalSandboxDataDirectoryPath {
274-
#if TARGET_OS_IPHONE
274+
#if PF_TARGET_OS_OSX
275+
return [self parseDefaultDataDirectoryPath];
276+
#else
275277
NSString *library = [NSHomeDirectory() stringByAppendingPathComponent:@"Library"];
276278
NSString *privateDocuments = [library stringByAppendingPathComponent:@"Private Documents"];
277279
NSString *directoryPath = [privateDocuments stringByAppendingPathComponent:_PFFileManagerParseDirectoryName];
@@ -281,8 +283,6 @@ - (NSString *)parseLocalSandboxDataDirectoryPath {
281283
[createDirectoryTask waitForResult:nil withMainThreadWarning:NO];
282284

283285
return directoryPath;
284-
#else
285-
return [self parseDefaultDataDirectoryPath];
286286
#endif
287287
}
288288

@@ -294,7 +294,7 @@ - (NSString *)parseCacheItemPathForPathComponent:(NSString *)component {
294294
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
295295
NSString *folderPath = paths.firstObject;
296296
folderPath = [folderPath stringByAppendingPathComponent:_PFFileManagerParseDirectoryName];
297-
#if !TARGET_OS_IPHONE
297+
#if PF_TARGET_OS_OSX
298298
// We append the applicationId in case the OS X application isn't sandboxed,
299299
// to avoid collisions in the generic ~/Library/Caches/Parse/------ dir.
300300
folderPath = [folderPath stringByAppendingPathComponent:self.applicationIdentifier];

Parse/Internal/PFLocationManager.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99

1010
#import <Foundation/Foundation.h>
1111

12+
#import <Parse/PFConstants.h>
13+
1214
@class CLLocation;
1315
@class CLLocationManager;
1416

15-
#if TARGET_OS_IPHONE
17+
#if !PF_TARGET_OS_OSX
1618

1719
@class UIApplication;
1820

@@ -39,7 +41,7 @@ typedef void(^PFLocationManagerLocationUpdateBlock)(CLLocation *location, NSErro
3941

4042
- (instancetype)initWithSystemLocationManager:(CLLocationManager *)manager;
4143

42-
#if TARGET_OS_IPHONE
44+
#if !PF_TARGET_OS_OSX
4345

4446
- (instancetype)initWithSystemLocationManager:(CLLocationManager *)manager
4547
application:(UIApplication *)application

Parse/Internal/PFReachability.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ + (BOOL)_reachabilityStateForFlags:(SCNetworkConnectionFlags)flags {
6666
}
6767
}
6868

69-
#if TARGET_OS_IPHONE
69+
#if !PF_TARGET_OS_OSX
7070
if (((flags & kSCNetworkReachabilityFlagsIsWWAN) == kSCNetworkReachabilityFlagsIsWWAN) &&
7171
((flags & kSCNetworkReachabilityFlagsConnectionRequired) == 0)) {
7272
// ... but WWAN connections are OK if the calling application

Tests/Other/ExtensionDataSharing/PFExtensionDataSharingTestHelper.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ + (NSString *)sharedTestDirectoryPath {
3232
}
3333

3434
+ (NSString *)sharedTestDirectoryPathForGroupIdentifier:(NSString *)groupIdentifier {
35-
#if TARGET_OS_IPHONE
36-
return [[PFExtensionDataSharingTestHelper sharedTestDirectoryPath] stringByAppendingPathComponent:groupIdentifier];
37-
#else
35+
#if PF_TARGET_OS_OSX
3836
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
3937
return [paths firstObject];
38+
#else
39+
return [[PFExtensionDataSharingTestHelper sharedTestDirectoryPath] stringByAppendingPathComponent:groupIdentifier];
4040
#endif
4141
}
4242

0 commit comments

Comments
 (0)