mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-23 20:31:13 +08:00
Convert RestKit to ARC
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user