Convert RestKit to ARC

This commit is contained in:
Blake Watters
2012-08-28 17:34:58 -04:00
parent 274478448d
commit ce6b0829e4
81 changed files with 2615 additions and 3128 deletions

View File

@@ -33,8 +33,8 @@ BOOL RKObjectIsValueEqualToValue(id sourceValue, id destinationValue);
@property (nonatomic, strong, readonly) RKAttributeMapping *mapping;
@property (nonatomic, strong, readonly) id value;
@property (nonatomic, readonly) NSString *sourceKeyPath;
@property (nonatomic, readonly) NSString *destinationKeyPath;
@property (weak, nonatomic, readonly) NSString *sourceKeyPath;
@property (weak, nonatomic, readonly) NSString *destinationKeyPath;
+ (RKMappingTestEvent *)eventWithMapping:(RKAttributeMapping *)mapping value:(id)value;

View File

@@ -60,7 +60,7 @@
@param fixtureName The name of the fixture file.
@return A new image object for the specified fixture, or nil if the method could not initialize the image from the specified file.
*/
+ (UIImage *)imageWithContentsOfFixture:(NSString *)fixtureName;
//+ (UIImage *)imageWithContentsOfFixture:(NSString *)fixtureName;
#endif
/**

View File

@@ -34,8 +34,6 @@ static NSBundle *fixtureBundle = nil;
+ (void)setFixtureBundle:(NSBundle *)bundle
{
NSAssert(bundle != nil, @"Bundle for fixture cannot be nil.");
[bundle retain];
[fixtureBundle release];
fixtureBundle = bundle;
}
@@ -44,12 +42,12 @@ static NSBundle *fixtureBundle = nil;
return [[self fixtureBundle] pathForResource:fixtureName ofType:nil];
}
#if TARGET_OS_IPHONE
+ (UIImage *)imageWithContentsOfFixture:(NSString *)fixtureName
{
return [[self fixtureBundle] imageWithContentsOfResource:fixtureName withExtension:nil];
}
#endif
//#if TARGET_OS_IPHONE
//+ (UIImage *)imageWithContentsOfFixture:(NSString *)fixtureName
//{
// return [[self fixtureBundle] imageWithContentsOfResource:fixtureName withExtension:nil];
//}
//#endif
+ (NSString *)stringWithContentsOfFixture:(NSString *)fixtureName
{

View File

@@ -26,7 +26,7 @@
Can be nil.
*/
@property (nonatomic, assign) id object;
@property (nonatomic, weak) id object;
/**
The timeout interval, in seconds, to wait for the notification to be posted.

View File

@@ -11,7 +11,7 @@
@interface RKTestNotificationObserver ()
@property (nonatomic, assign, getter = isObserverAdded) BOOL observerAdded;
@property (nonatomic, assign, getter = isAwaitingNotification) BOOL awaitingNotification;
@property (nonatomic, retain) NSDate *startDate;
@property (nonatomic, strong) NSDate *startDate;
@end
@implementation RKTestNotificationObserver
@@ -38,7 +38,7 @@
+ (RKTestNotificationObserver *)notificationObserver
{
return [[[self alloc] init] autorelease];
return [[self alloc] init];
}
+ (RKTestNotificationObserver *)notificationObserverForName:(NSString *)notificationName object:(id)object
@@ -67,7 +67,6 @@
- (void)dealloc
{
[self removeObserver];
[super dealloc];
}
- (void)addObserver

View File

@@ -34,12 +34,12 @@
/**
The RKResponse object loaded from the RKRequest or RKObjectLoader the receiver is acting as the delegate for.
**/
@property (nonatomic, retain, readonly) NSHTTPURLResponse *response;
@property (nonatomic, strong, readonly) NSHTTPURLResponse *response;
/**
The collection of objects loaded from the RKObjectLoader the receiver is acting as the delegate for.
*/
@property (nonatomic, retain, readonly) NSArray *objects;
@property (nonatomic, strong, readonly) NSArray *objects;
/**
A Boolean value that indicates whether a response was loaded successfully.

View File

@@ -30,9 +30,9 @@ NSString * const RKTestResponseLoaderTimeoutException = @"RKTestResponseLoaderTi
@interface RKTestResponseLoader ()
@property (nonatomic, assign, getter = isAwaitingResponse) BOOL awaitingResponse;
@property (nonatomic, retain, readwrite) NSHTTPURLResponse *response;
@property (nonatomic, strong, readwrite) NSHTTPURLResponse *response;
@property (nonatomic, copy, readwrite) NSError *error;
@property (nonatomic, retain, readwrite) NSArray *objects;
@property (nonatomic, strong, readwrite) NSArray *objects;
@end
@@ -49,7 +49,7 @@ NSString * const RKTestResponseLoaderTimeoutException = @"RKTestResponseLoaderTi
+ (RKTestResponseLoader *)responseLoader
{
return [[[self alloc] init] autorelease];
return [[self alloc] init];
}
- (id)init
@@ -63,17 +63,6 @@ NSString * const RKTestResponseLoaderTimeoutException = @"RKTestResponseLoaderTi
return self;
}
- (void)dealloc
{
[_response release];
_response = nil;
[_error release];
_error = nil;
[_objects release];
_objects = nil;
[super dealloc];
}
- (void)waitForResponse
{