mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-02 09:31:32 +08:00
Fix static analyzer issues
This commit is contained in:
@@ -106,11 +106,11 @@
|
||||
|
||||
NSError *error = nil;
|
||||
NSArray *objectIDs = [self.managedObjectContext executeFetchRequest:fetchRequest error:&error];
|
||||
[fetchRequest release];
|
||||
if (error) {
|
||||
RKLogError(@"Failed to load entity cache: %@", error);
|
||||
return;
|
||||
}
|
||||
[fetchRequest release];
|
||||
|
||||
self.attributeValuesToObjectIDs = [NSMutableDictionary dictionaryWithCapacity:[objectIDs count]];
|
||||
for (NSManagedObjectID *objectID in objectIDs) {
|
||||
|
||||
@@ -15,7 +15,7 @@ RK_FIX_CATEGORY_BUG(RKObjectMappingProvider_CoreData)
|
||||
|
||||
- (void)setObjectMapping:(RKObjectMappingDefinition *)objectMapping forResourcePathPattern:(NSString *)resourcePath withFetchRequestBlock:(RKObjectMappingProviderFetchRequestBlock)fetchRequestBlock {
|
||||
[self setEntry:[RKObjectMappingProviderContextEntry contextEntryWithMapping:objectMapping
|
||||
userData:[fetchRequestBlock copy]] forResourcePathPattern:resourcePath];
|
||||
userData:Block_copy(fetchRequestBlock)] forResourcePathPattern:resourcePath];
|
||||
}
|
||||
|
||||
- (NSFetchRequest *)fetchRequestForResourcePath:(NSString *)resourcePath {
|
||||
|
||||
@@ -126,8 +126,8 @@ NSString *RKPathAppendQueryParams(NSString *resourcePath, NSDictionary *queryPar
|
||||
- (id)init {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.HTTPHeaders = [[NSMutableDictionary alloc] init];
|
||||
self.additionalRootCertificates = [[NSMutableSet alloc] init];
|
||||
self.HTTPHeaders = [NSMutableDictionary dictionary];
|
||||
self.additionalRootCertificates = [NSMutableSet set];
|
||||
self.defaultHTTPEncoding = NSUTF8StringEncoding;
|
||||
self.cacheTimeoutInterval = 0;
|
||||
self.runLoopMode = NSRunLoopCommonModes;
|
||||
|
||||
@@ -103,8 +103,7 @@ static dispatch_queue_t defaultMappingQueue = nil;
|
||||
- (id)initWithBaseURL:(RKURL *)baseURL {
|
||||
self = [self init];
|
||||
if (self) {
|
||||
self.client = [[RKClient alloc] initWithBaseURL:baseURL];
|
||||
[self.client release];
|
||||
self.client = [RKClient clientWithBaseURL:baseURL];
|
||||
self.acceptMIMEType = RKMIMETypeJSON;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
}
|
||||
|
||||
+ (RKObjectMappingProviderContextEntry *)contextEntryWithMapping:(RKObjectMappingDefinition *)mapping userData:(id)userData {
|
||||
RKObjectMappingProviderContextEntry * contextEntry = [RKObjectMappingProviderContextEntry contextEntryWithMapping:mapping];
|
||||
RKObjectMappingProviderContextEntry *contextEntry = [RKObjectMappingProviderContextEntry contextEntryWithMapping:mapping];
|
||||
contextEntry.userData = userData;
|
||||
return contextEntry;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ static NSMutableDictionary * __sharedBenchmarks = nil;
|
||||
# pragma mark Initializers
|
||||
|
||||
+ (id)benchmarkWithName:(NSString *)name {
|
||||
return [[self alloc] initWithName:name];
|
||||
return [[[self alloc] initWithName:name] autorelease];
|
||||
}
|
||||
|
||||
- (id)initWithName:(NSString *)name {
|
||||
|
||||
Reference in New Issue
Block a user