Use instancetype in constructors for increased subclassing friendliness

This commit is contained in:
Blake Watters
2012-12-22 14:54:49 -05:00
parent 929cd44bd7
commit b78deb3eed
47 changed files with 102 additions and 106 deletions

View File

@@ -75,7 +75,7 @@
@param objectClass The class that the mapping targets.
@return A new mapping object.
*/
+ (id)mappingForClass:(Class)objectClass;
+ (instancetype)mappingForClass:(Class)objectClass;
/**
Initializes the receiver with a given object class. This is the designated initializer.
@@ -83,7 +83,7 @@
@param objectClass The class that the mapping targets. Cannot be `nil`.
@return The receiver, initialized with the given class.
*/
- (id)initWithClass:(Class)objectClass;
- (instancetype)initWithClass:(Class)objectClass;
/**
Returns an object mapping with an `objectClass` of `NSMutableDictionary`.
@@ -94,7 +94,7 @@
@see `RKObjectParameterization`
@see `RKObjectManager`
*/
+ (id)requestMapping;
+ (instancetype)requestMapping;
///---------------------------------
/// @name Managing Property Mappings
@@ -298,7 +298,7 @@
quickly generate a corresponding serialization mapping from a configured object mapping. The inverse
mapping will have the source and destination keyPaths swapped for all attribute and relationship mappings.
*/
- (RKObjectMapping *)inverseMapping;
- (instancetype)inverseMapping;
///---------------------------------------------------
/// @name Obtaining Information About the Target Class
@@ -313,7 +313,6 @@
@return The class of the property.
*/
- (Class)classForProperty:(NSString *)propertyName;
// TODO: Can I eliminate this and just use classForKeyPath:????
/**
Returns the class of the attribute or relationship property of the target `objectClass` at the given key path.