Skip to content

Commit 97ea9fc

Browse files
committed
Use type-safe keypath constructor in PFFileState.
1 parent 14c0da0 commit 97ea9fc

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

Parse/Internal/File/State/PFFileState.m

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@ @implementation PFFileState
2828
///--------------------------------------
2929

3030
+ (NSDictionary *)propertyAttributes {
31-
return @{
32-
@"name" : [PFPropertyAttributes attributesWithAssociationType:PFPropertyInfoAssociationTypeCopy],
33-
@"urlString" : [PFPropertyAttributes attributesWithAssociationType:PFPropertyInfoAssociationTypeCopy],
34-
@"mimeType" : [PFPropertyAttributes attributesWithAssociationType:PFPropertyInfoAssociationTypeCopy],
35-
};
31+
return @{ PFFileStatePropertyName(name) : [PFPropertyAttributes attributesWithAssociationType:PFPropertyInfoAssociationTypeCopy],
32+
PFFileStatePropertyName(urlString) : [PFPropertyAttributes attributesWithAssociationType:PFPropertyInfoAssociationTypeCopy],
33+
PFFileStatePropertyName(mimeType) : [PFPropertyAttributes attributesWithAssociationType:PFPropertyInfoAssociationTypeCopy] };
3634
}
3735

3836
///--------------------------------------

Parse/Internal/File/State/PFFileState_Private.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@
99

1010
#import "PFFileState.h"
1111

12+
#import "PFMacros.h"
13+
14+
/**
15+
Returns NSString representation of a property.
16+
17+
@param NAME The name of the property.
18+
19+
@return NSString representation of a given property.
20+
*/
21+
#define PFFileStatePropertyName(NAME) @keypath(PFFileState, NAME)
22+
1223
NS_ASSUME_NONNULL_BEGIN
1324

1425
@interface PFFileState ()

0 commit comments

Comments
 (0)