mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-28 12:45:33 +08:00
Drop instancetype from init methods since the compiler will infer it
This commit is contained in:
@@ -88,7 +88,7 @@
|
||||
@param sourceToDestinationEntityAttributes A dictionary specifying how attributes on the source entity correspond to attributes on the destination entity.
|
||||
@return The receiver, initialized with the given relationship and attributes.
|
||||
*/
|
||||
- (instancetype)initWithRelationship:(NSRelationshipDescription *)relationship attributes:(NSDictionary *)sourceToDestinationEntityAttributes;
|
||||
- (id)initWithRelationship:(NSRelationshipDescription *)relationship attributes:(NSDictionary *)sourceToDestinationEntityAttributes;
|
||||
|
||||
/**
|
||||
The dictionary of attributes specifying how attributes on the source entity for the relationship correspond to attributes on the destination entity.
|
||||
@@ -115,7 +115,7 @@
|
||||
@param keyPath The key path from which to read the value that is to be set for the relationship.
|
||||
@return The receiver, initialized with the given relationship and key path.
|
||||
*/
|
||||
- (instancetype)initWithRelationship:(NSRelationshipDescription *)relationship keyPath:(NSString *)keyPath;
|
||||
- (id)initWithRelationship:(NSRelationshipDescription *)relationship keyPath:(NSString *)keyPath;
|
||||
|
||||
/**
|
||||
The key path that is to be evaluated to obtain the value for the relationship.
|
||||
|
||||
@@ -44,7 +44,7 @@ static NSSet *RKSetWithInvalidAttributesForEntity(NSArray *attributes, NSEntityD
|
||||
|
||||
@implementation RKConnectionDescription
|
||||
|
||||
- (instancetype)initWithRelationship:(NSRelationshipDescription *)relationship attributes:(NSDictionary *)attributes
|
||||
- (id)initWithRelationship:(NSRelationshipDescription *)relationship attributes:(NSDictionary *)attributes
|
||||
{
|
||||
NSParameterAssert(relationship);
|
||||
NSParameterAssert(attributes);
|
||||
@@ -63,7 +63,7 @@ static NSSet *RKSetWithInvalidAttributesForEntity(NSArray *attributes, NSEntityD
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithRelationship:(NSRelationshipDescription *)relationship keyPath:(NSString *)keyPath
|
||||
- (id)initWithRelationship:(NSRelationshipDescription *)relationship keyPath:(NSString *)keyPath
|
||||
{
|
||||
NSParameterAssert(relationship);
|
||||
NSParameterAssert(keyPath);
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
@return The receiver, initialized with the given entity, attribute, and managed object
|
||||
context.
|
||||
*/
|
||||
- (instancetype)initWithEntity:(NSEntityDescription *)entity attributes:(NSArray *)attributeNames managedObjectContext:(NSManagedObjectContext *)context;
|
||||
- (id)initWithEntity:(NSEntityDescription *)entity attributes:(NSArray *)attributeNames managedObjectContext:(NSManagedObjectContext *)context;
|
||||
|
||||
///-----------------------------
|
||||
/// @name Getting Cache Identity
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
@param context The managed object context containing objects to be cached.
|
||||
@returns self, initialized with context.
|
||||
*/
|
||||
- (instancetype)initWithManagedObjectContext:(NSManagedObjectContext *)context;
|
||||
- (id)initWithManagedObjectContext:(NSManagedObjectContext *)context;
|
||||
|
||||
/**
|
||||
The managed object context with which the receiver is associated.
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
@param entity An entity with which to initialize the receiver.
|
||||
@returns The receiver, initialized with the given entity.
|
||||
*/
|
||||
- (instancetype)initWithEntity:(NSEntityDescription *)entity;
|
||||
- (id)initWithEntity:(NSEntityDescription *)entity;
|
||||
|
||||
/**
|
||||
A convenience initializer that creates and returns an entity mapping for the entity with the given name in
|
||||
|
||||
@@ -153,7 +153,7 @@ static BOOL entityIdentificationInferenceEnabled = YES;
|
||||
return [[self alloc] initWithEntity:entity];
|
||||
}
|
||||
|
||||
- (instancetype)initWithEntity:(NSEntityDescription *)entity
|
||||
- (id)initWithEntity:(NSEntityDescription *)entity
|
||||
{
|
||||
NSAssert(entity, @"Cannot initialize an RKEntityMapping without an entity. Maybe you want RKObjectMapping instead?");
|
||||
Class objectClass = NSClassFromString([entity managedObjectClassName]);
|
||||
@@ -167,7 +167,7 @@ static BOOL entityIdentificationInferenceEnabled = YES;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithClass:(Class)objectClass
|
||||
- (id)initWithClass:(Class)objectClass
|
||||
{
|
||||
self = [super initWithClass:objectClass];
|
||||
if (self) {
|
||||
|
||||
@@ -35,6 +35,6 @@
|
||||
@param managedObjectContext The managed object context with which to initialize the receiver.
|
||||
@return The receiver, initialized with the given managed object context.
|
||||
*/
|
||||
- (instancetype)initWithManagedObjectContext:(NSManagedObjectContext *)managedObjectContext;
|
||||
- (id)initWithManagedObjectContext:(NSManagedObjectContext *)managedObjectContext;
|
||||
|
||||
@end
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
@warning As this initialization code path is typical for generating seed databases, the value of
|
||||
`resetsStoreBeforeImporting` is initialized to **YES**.
|
||||
*/
|
||||
- (instancetype)initWithManagedObjectModel:(NSManagedObjectModel *)managedObjectModel storePath:(NSString *)storePath;
|
||||
- (id)initWithManagedObjectModel:(NSManagedObjectModel *)managedObjectModel storePath:(NSString *)storePath;
|
||||
|
||||
/**
|
||||
Initializes the receiver with a given persistent store in which to persist imported managed objects.
|
||||
@@ -69,7 +69,7 @@
|
||||
managed object model are determined from the given persistent store and a new managed object context with
|
||||
the private queue concurrency type is constructed.
|
||||
*/
|
||||
- (instancetype)initWithPersistentStore:(NSPersistentStore *)persistentStore;
|
||||
- (id)initWithPersistentStore:(NSPersistentStore *)persistentStore;
|
||||
|
||||
/**
|
||||
A Boolean value indicating whether existing managed objects in the persistent store should
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
@param managedObjectCache The managed object cache used by the receiver to find existing object instances by their identification attributes.
|
||||
@return The receiver, initialized with the given managed object context and managed objet cache.
|
||||
*/
|
||||
- (instancetype)initWithManagedObjectContext:(NSManagedObjectContext *)managedObjectContext cache:(id<RKManagedObjectCaching>)managedObjectCache;
|
||||
- (id)initWithManagedObjectContext:(NSManagedObjectContext *)managedObjectContext cache:(id<RKManagedObjectCaching>)managedObjectCache;
|
||||
|
||||
///-----------------------------------------------------
|
||||
/// @name Accessing the Managed Object Context and Cache
|
||||
|
||||
@@ -130,7 +130,7 @@ extern NSString * const RKObjectMappingNestingAttributeKeyName;
|
||||
|
||||
@implementation RKManagedObjectMappingOperationDataSource
|
||||
|
||||
- (instancetype)initWithManagedObjectContext:(NSManagedObjectContext *)managedObjectContext cache:(id<RKManagedObjectCaching>)managedObjectCache
|
||||
- (id)initWithManagedObjectContext:(NSManagedObjectContext *)managedObjectContext cache:(id<RKManagedObjectCaching>)managedObjectCache
|
||||
{
|
||||
NSParameterAssert(managedObjectContext);
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
RKManagedObjectStore *managedObjectStore = [[RKManagedObjectStore alloc] initWithManagedObjectModel:managedObjectModel];
|
||||
|
||||
*/
|
||||
- (instancetype)initWithManagedObjectModel:(NSManagedObjectModel *)managedObjectModel;
|
||||
- (id)initWithManagedObjectModel:(NSManagedObjectModel *)managedObjectModel;
|
||||
|
||||
/**
|
||||
Initializes the receiver with an existing persistent store coordinator.
|
||||
@@ -88,7 +88,7 @@
|
||||
@param persistentStoreCoordinator The persistent store coordinator with which to initialize the receiver.
|
||||
@return The receiver, initialized with the managed object model of the given persistent store coordinator and the persistent store coordinator.
|
||||
*/
|
||||
- (instancetype)initWithPersistentStoreCoordinator:(NSPersistentStoreCoordinator *)persistentStoreCoordinator;
|
||||
- (id)initWithPersistentStoreCoordinator:(NSPersistentStoreCoordinator *)persistentStoreCoordinator;
|
||||
|
||||
/**
|
||||
Initializes the receiver with a managed object model obtained by merging the models from all of the application's non-framework bundles.
|
||||
@@ -98,7 +98,7 @@
|
||||
|
||||
@warning Obtaining a managed object model by merging all bundles may result in an application error if versioned object models are in use.
|
||||
*/
|
||||
- (instancetype)init;
|
||||
- (id)init;
|
||||
|
||||
///-----------------------------------------------------------------------------
|
||||
/// @name Configuring Persistent Stores
|
||||
|
||||
@@ -57,7 +57,7 @@ static RKManagedObjectStore *defaultStore = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (instancetype)initWithManagedObjectModel:(NSManagedObjectModel *)managedObjectModel
|
||||
- (id)initWithManagedObjectModel:(NSManagedObjectModel *)managedObjectModel
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
@@ -73,7 +73,7 @@ static RKManagedObjectStore *defaultStore = nil;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithPersistentStoreCoordinator:(NSPersistentStoreCoordinator *)persistentStoreCoordinator
|
||||
- (id)initWithPersistentStoreCoordinator:(NSPersistentStoreCoordinator *)persistentStoreCoordinator
|
||||
{
|
||||
self = [self initWithManagedObjectModel:persistentStoreCoordinator.managedObjectModel];
|
||||
if (self) {
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
@param managedObjectCache The managed object cache from which to attempt to fetch a matching object to satisfy the connection.
|
||||
@return The receiver, initialized with the given managed object, connection mapping, and managed object cache.
|
||||
*/
|
||||
- (instancetype)initWithManagedObject:(NSManagedObject *)managedObject
|
||||
- (id)initWithManagedObject:(NSManagedObject *)managedObject
|
||||
connection:(RKConnectionDescription *)connection
|
||||
managedObjectCache:(id<RKManagedObjectCaching>)managedObjectCache;
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ static NSDictionary *RKConnectionAttributeValuesWithObject(RKConnectionDescripti
|
||||
|
||||
@implementation RKRelationshipConnectionOperation
|
||||
|
||||
- (instancetype)initWithManagedObject:(NSManagedObject *)managedObject
|
||||
- (id)initWithManagedObject:(NSManagedObject *)managedObject
|
||||
connection:(RKConnectionDescription *)connection
|
||||
managedObjectCache:(id<RKManagedObjectCaching>)managedObjectCache;
|
||||
{
|
||||
|
||||
@@ -262,7 +262,7 @@ RKMappingResult, RKRequestDescriptor, RKResponseDescriptor;
|
||||
@param client The AFNetworking HTTP client with which to initialize the receiver.
|
||||
@return The receiver, initialized with the given client.
|
||||
*/
|
||||
- (instancetype)initWithHTTPClient:(AFHTTPClient *)client;
|
||||
- (id)initWithHTTPClient:(AFHTTPClient *)client;
|
||||
|
||||
///------------------------------------------
|
||||
/// @name Accessing Object Manager Properties
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
@param responseDescriptors An array of `RKResponseDescriptor` objects specifying how object mapping is to be performed on the response loaded by the network operation.
|
||||
@return The receiver, initialized with the given request and response descriptors.
|
||||
*/
|
||||
- (instancetype)initWithHTTPRequestOperation:(RKHTTPRequestOperation *)requestOperation responseDescriptors:(NSArray *)responseDescriptors;
|
||||
- (id)initWithHTTPRequestOperation:(RKHTTPRequestOperation *)requestOperation responseDescriptors:(NSArray *)responseDescriptors;
|
||||
|
||||
/**
|
||||
Initializes an object request operation with a request object and a set of response descriptors.
|
||||
@@ -87,7 +87,7 @@
|
||||
@param responseDescriptors An array of `RKResponseDescriptor` objects specifying how object mapping is to be performed on the response loaded by the network operation.
|
||||
@return The receiver, initialized with the given request and response descriptors.
|
||||
*/
|
||||
- (instancetype)initWithRequest:(NSURLRequest *)request responseDescriptors:(NSArray *)responseDescriptors;
|
||||
- (id)initWithRequest:(NSURLRequest *)request responseDescriptors:(NSArray *)responseDescriptors;
|
||||
|
||||
///---------------------------------
|
||||
/// @name Configuring Object Mapping
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
@param responseDescriptors An array of response descriptors describing how to map object representations loaded by object request operations dispatched by the paginator.
|
||||
@return The receiver, initialized with the request, pagination mapping, and response descriptors.
|
||||
*/
|
||||
- (instancetype)initWithRequest:(NSURLRequest *)request
|
||||
- (id)initWithRequest:(NSURLRequest *)request
|
||||
paginationMapping:(RKObjectMapping *)paginationMapping
|
||||
responseDescriptors:(NSArray *)responseDescriptors;
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
@param responseDescriptors An array whose elements are `RKResponseDescriptor` objects specifying object mapping configurations that may be applied to the response.
|
||||
@return The receiver, initialized with the response, data, and response descriptor objects.
|
||||
*/
|
||||
- (instancetype)initWithResponse:(NSHTTPURLResponse *)response
|
||||
- (id)initWithResponse:(NSHTTPURLResponse *)response
|
||||
data:(NSData *)data
|
||||
responseDescriptors:(NSArray *)responseDescriptors;
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
@param baseURL The base URL with which to initialize the receiver.
|
||||
@return The receiver, initialized with the given base URL.
|
||||
*/
|
||||
- (instancetype)initWithBaseURL:(NSURL *)baseURL;
|
||||
- (id)initWithBaseURL:(NSURL *)baseURL;
|
||||
|
||||
///----------------------
|
||||
/// @name Generating URLs
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
@param mappingsDictionary An `NSDictionary` wherein the keys are mappable key paths in `object` and the values are `RKMapping` objects specifying how the representations at its key path are to be mapped.
|
||||
@return The receiver, initialized with the given object and and dictionary of key paths to mappings.
|
||||
*/
|
||||
- (instancetype)initWithRepresentation:(id)representation mappingsDictionary:(NSDictionary *)mappingsDictionary;
|
||||
- (id)initWithRepresentation:(id)representation mappingsDictionary:(NSDictionary *)mappingsDictionary;
|
||||
|
||||
///------------------------------------------
|
||||
/// @name Accessing Mapping Result and Errors
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
@param objectOrDynamicMapping An instance of `RKObjectMapping` or `RKDynamicMapping` defining how the mapping is to be performed.
|
||||
@return The receiver, initialized with a source object, a destination object, and a mapping.
|
||||
*/
|
||||
- (instancetype)initWithSourceObject:(id)sourceObject destinationObject:(id)destinationObject mapping:(RKMapping *)objectOrDynamicMapping;
|
||||
- (id)initWithSourceObject:(id)sourceObject destinationObject:(id)destinationObject mapping:(RKMapping *)objectOrDynamicMapping;
|
||||
|
||||
///--------------------------------------
|
||||
/// @name Accessing Mapping Configuration
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
@param dictionary A dictionary wherein the keys represent mapped key paths and the values represent the objects mapped at those key paths. Cannot be nil.
|
||||
@return The receiver, initialized with the given dictionary.
|
||||
*/
|
||||
- (instancetype)initWithDictionary:(NSDictionary *)dictionary;
|
||||
- (id)initWithDictionary:(NSDictionary *)dictionary;
|
||||
|
||||
///----------------------------------------
|
||||
/// @name Retrieving Result Representations
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
@param objectClass The class that the mapping targets. Cannot be `nil`.
|
||||
@return The receiver, initialized with the given class.
|
||||
*/
|
||||
- (instancetype)initWithClass:(Class)objectClass;
|
||||
- (id)initWithClass:(Class)objectClass;
|
||||
|
||||
/**
|
||||
Returns an object mapping with an `objectClass` of `NSMutableDictionary`.
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
@param value The value that is expected to be set for the relationship when the connection is established.
|
||||
@return The receiver, initialized with the given relationship name, attributes dictionary, and expected value.
|
||||
*/
|
||||
- (instancetype)initWithRelationshipName:(NSString *)relationshipName attributes:(NSDictionary *)attributes value:(id)value;
|
||||
- (id)initWithRelationshipName:(NSString *)relationshipName attributes:(NSDictionary *)attributes value:(id)value;
|
||||
|
||||
///------------------------------------
|
||||
/// @name Accessing Expectation Details
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
return [[self alloc] initWithRelationshipName:relationshipName attributes:attributes value:value];
|
||||
}
|
||||
|
||||
- (instancetype)initWithRelationshipName:(NSString *)relationshipName attributes:(NSDictionary *)attributes value:(id)value
|
||||
- (id)initWithRelationshipName:(NSString *)relationshipName attributes:(NSDictionary *)attributes value:(id)value
|
||||
{
|
||||
NSParameterAssert(relationshipName);
|
||||
NSAssert(value == nil ||
|
||||
|
||||
@@ -105,7 +105,7 @@ extern NSString * const RKMappingTestExpectationErrorKey;
|
||||
@param destinationObject The destionation object being to.
|
||||
@return The receiver, initialized with mapping, sourceObject and destinationObject.
|
||||
*/
|
||||
- (instancetype)initWithMapping:(RKMapping *)mapping sourceObject:(id)sourceObject destinationObject:(id)destinationObject;
|
||||
- (id)initWithMapping:(RKMapping *)mapping sourceObject:(id)sourceObject destinationObject:(id)destinationObject;
|
||||
|
||||
///----------------------------
|
||||
/// @name Managing Expectations
|
||||
|
||||
Reference in New Issue
Block a user