Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Replacing string constants with property-equivalent literals

Minor formatting
  • Loading branch information...
commit 3e02873b5e2261bc431776a85b3184420d01f673 1 parent 4c9da20
@mattt mattt authored
Showing with 16 additions and 22 deletions.
  1. +16 −22 AFOAuth1Client/AFOAuth1Client.m
View
38 AFOAuth1Client/AFOAuth1Client.m
@@ -372,12 +372,6 @@ - (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method
#pragma mark -
-NSString * const AFOAuth1TokenEncodingKeyKey = @"AFOAuth1TokenEncodingKeyKey";
-NSString * const AFOAuth1TokenEncodingKeySecret = @"AFOAuth1TokenEncodingKeySecret";
-NSString * const AFOAuth1TokenEncodingKeySession = @"AFOAuth1TokenEncodingKeySession";
-NSString * const AFOAuth1TokenEncodingKeyExpiration = @"AFOAuth1TokenEncodingKeyExpiration";
-NSString * const AFOAuth1TokenEncodingKeyRenewable = @"AFOAuth1TokenEncodingKeyRenewable";
-
@interface AFOAuth1Token ()
@property (readwrite, nonatomic, copy) NSString *key;
@property (readwrite, nonatomic, copy) NSString *secret;
@@ -438,29 +432,29 @@ - (id)initWithKey:(NSString *)key
return self;
}
-- (void)encodeWithCoder:(NSCoder *)coder
-{
- [coder encodeObject:self.key forKey:AFOAuth1TokenEncodingKeyKey];
- [coder encodeObject:self.secret forKey:AFOAuth1TokenEncodingKeySecret];
- [coder encodeObject:self.session forKey:AFOAuth1TokenEncodingKeySession];
- [coder encodeObject:self.expiration forKey:AFOAuth1TokenEncodingKeyExpiration];
- [coder encodeBool:self.renewable forKey:AFOAuth1TokenEncodingKeyRenewable];
-}
+#pragma mark - NSCoding
-- (id)initWithCoder:(NSCoder *)decoder
-{
+- (id)initWithCoder:(NSCoder *)decoder {
self = [super init];
if (!self) {
- return nil;
+ return nil;
}
- self.key = [decoder decodeObjectForKey:AFOAuth1TokenEncodingKeyKey];
- self.secret = [decoder decodeObjectForKey:AFOAuth1TokenEncodingKeySecret];
- self.session = [decoder decodeObjectForKey:AFOAuth1TokenEncodingKeySession];
- self.expiration = [decoder decodeObjectForKey:AFOAuth1TokenEncodingKeyExpiration];
- self.renewable = [decoder decodeBoolForKey:AFOAuth1TokenEncodingKeyRenewable];
+ self.key = [decoder decodeObjectForKey:@"key"];
+ self.secret = [decoder decodeObjectForKey:@"secret"];
+ self.session = [decoder decodeObjectForKey:@"session"];
+ self.expiration = [decoder decodeObjectForKey:@"expiration"];
+ self.renewable = [decoder decodeBoolForKey:@"renewable"];
return self;
}
+- (void)encodeWithCoder:(NSCoder *)coder {
+ [coder encodeObject:self.key forKey:@"key"];
+ [coder encodeObject:self.secret forKey:@"secret"];
+ [coder encodeObject:self.session forKey:@"session"];
+ [coder encodeObject:self.expiration forKey:@"expiration"];
+ [coder encodeBool:self.renewable forKey:@"renewable"];
+}
+
@end
Please sign in to comment.
Something went wrong with that request. Please try again.