Permalink
Browse files

Making AFOAuth1Token conform to NSCopying

  • Loading branch information...
mattt committed May 7, 2013
1 parent 5030fba commit 1880c44787abd8be804e985c1fa55e604ebdf064
Showing with 14 additions and 1 deletion.
  1. +1 −1 AFOAuth1Client/AFOAuth1Client.h
  2. +13 −0 AFOAuth1Client/AFOAuth1Client.m
@@ -123,7 +123,7 @@ extern NSString * const kAFApplicationLaunchOptionsURLKey;
/**
*/
-@interface AFOAuth1Token : NSObject <NSCoding>
+@interface AFOAuth1Token : NSObject <NSCoding, NSCopying>
/**
@@ -487,4 +487,17 @@ - (void)encodeWithCoder:(NSCoder *)coder {
[coder encodeBool:self.renewable forKey:@"renewable"];
}
+#pragma mark - NSCopying
+
+- (id)copyWithZone:(NSZone *)zone {
+ AFOAuth1Token *copy = [[[self class] allocWithZone:zone] init];
+ copy.key = self.key;
+ copy.secret = self.secret;
+ copy.session = self.session;
+ copy.expiration = self.expiration;
+ copy.renewable = self.renewable;
+
+ return copy;
+}
+
@end

0 comments on commit 1880c44

Please sign in to comment.