mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-12 22:40:25 +08:00
Use instancetype in constructors for increased subclassing friendliness
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user