diff --git a/AFNetworking/AFHTTPClient.h b/AFNetworking/AFHTTPClient.h index 8a23490..cdc1666 100644 --- a/AFNetworking/AFHTTPClient.h +++ b/AFNetworking/AFHTTPClient.h @@ -125,15 +125,7 @@ extern NSString * AFQueryStringFromParametersWithEncoding(NSDictionary *paramete [NSURL URLWithString:@"http://example2.com/" relativeToURL:baseURL]; // http://example2.com/ */ -@interface AFHTTPClient : NSObject { -@private - NSURL *_baseURL; - NSStringEncoding _stringEncoding; - AFHTTPClientParameterEncoding _parameterEncoding; - NSMutableArray *_registeredHTTPOperationClassNames; - NSMutableDictionary *_defaultHeaders; - NSOperationQueue *_operationQueue; -} +@interface AFHTTPClient : NSObject ///--------------------------------------- /// @name Accessing HTTP Client Properties diff --git a/AFNetworking/AFHTTPClient.m b/AFNetworking/AFHTTPClient.m index 5724c5d..4e3bbd1 100644 --- a/AFNetworking/AFHTTPClient.m +++ b/AFNetworking/AFHTTPClient.m @@ -125,7 +125,8 @@ NSString * AFURLEncodedStringFromStringWithEncoding(NSString *string, NSStringEn @property (readwrite, nonatomic, retain) id key; @property (readwrite, nonatomic, retain) id value; -- (id)initWithKey:(NSString *)key value:(NSString *)value; +- (id)initWithKey:(id)key value:(id)value; +- (NSString *)URLEncodedStringValueWithEncoding:(NSStringEncoding)stringEncoding; @end @@ -133,7 +134,7 @@ NSString * AFURLEncodedStringFromStringWithEncoding(NSString *string, NSStringEn @synthesize key = _key; @synthesize value = _value; -- (id)initWithKey:(NSString *)key value:(NSString *)value { +- (id)initWithKey:(id)key value:(id)value { self = [super init]; if (!self) { return nil; @@ -151,55 +152,56 @@ NSString * AFURLEncodedStringFromStringWithEncoding(NSString *string, NSStringEn [super dealloc]; } -- (NSString *)description { - return [NSString stringWithFormat:@"%@=%@", self.key, self.value]; +- (NSString *)URLEncodedStringValueWithEncoding:(NSStringEncoding)stringEncoding { + return [NSString stringWithFormat:@"%@=%@", self.key, AFURLEncodedStringFromStringWithEncoding([self.value description], stringEncoding)]; } @end #pragma mark - -extern NSArray * AFQueryStringComponentsFromKeyAndValueWithEncoding(NSString *key, id value, NSStringEncoding stringEncoding); -extern NSArray * AFQueryStringComponentsFromKeyAndDictionaryValueWithEncoding(NSString *key, NSDictionary *value, NSStringEncoding stringEncoding); -extern NSArray * AFQueryStringComponentsFromKeyAndArrayValueWithEncoding(NSString *key, NSArray *value, NSStringEncoding stringEncoding); +extern NSArray * AFQueryStringComponentsFromKeyAndValue(NSString *key, id value); +extern NSArray * AFQueryStringComponentsFromKeyAndDictionaryValue(NSString *key, NSDictionary *value); +extern NSArray * AFQueryStringComponentsFromKeyAndArrayValue(NSString *key, NSArray *value); -NSString * AFQueryStringFromParametersWithEncoding(NSDictionary *parameters, NSStringEncoding stringEncoding) { - return [[AFQueryStringComponentsFromKeyAndValueWithEncoding(nil, parameters, stringEncoding) valueForKeyPath:@"description"] componentsJoinedByString:@"&"]; +NSString * AFQueryStringFromParametersWithEncoding(NSDictionary *parameters, NSStringEncoding stringEncoding) { + NSMutableArray *mutableComponents = [NSMutableArray array]; + for (AFQueryStringComponent *component in AFQueryStringComponentsFromKeyAndValue(nil, parameters)) { + [mutableComponents addObject:[component URLEncodedStringValueWithEncoding:stringEncoding]]; + } + + return [mutableComponents componentsJoinedByString:@"&"]; } -AFQueryStringComponent * AFQueryStringComponentFromKeyAndValueWithEncoding(id key, id value, NSStringEncoding stringEncoding) { - return [[[AFQueryStringComponent alloc] initWithKey:AFURLEncodedStringFromStringWithEncoding([key description], stringEncoding) value:AFURLEncodedStringFromStringWithEncoding([value description], stringEncoding)] autorelease]; -} - -NSArray * AFQueryStringComponentsFromKeyAndValueWithEncoding(NSString *key, id value, NSStringEncoding stringEncoding) { +NSArray * AFQueryStringComponentsFromKeyAndValue(NSString *key, id value) { NSMutableArray *mutableQueryStringComponents = [NSMutableArray array]; if([value isKindOfClass:[NSDictionary class]]) { - [mutableQueryStringComponents addObjectsFromArray:AFQueryStringComponentsFromKeyAndDictionaryValueWithEncoding(key, value, stringEncoding)]; + [mutableQueryStringComponents addObjectsFromArray:AFQueryStringComponentsFromKeyAndDictionaryValue(key, value)]; } else if([value isKindOfClass:[NSArray class]]) { - [mutableQueryStringComponents addObjectsFromArray:AFQueryStringComponentsFromKeyAndArrayValueWithEncoding(key, value, stringEncoding)]; + [mutableQueryStringComponents addObjectsFromArray:AFQueryStringComponentsFromKeyAndArrayValue(key, value)]; } else { - [mutableQueryStringComponents addObject:AFQueryStringComponentFromKeyAndValueWithEncoding(key, value, stringEncoding)]; + [mutableQueryStringComponents addObject:[[[AFQueryStringComponent alloc] initWithKey:key value:value] autorelease]]; } return mutableQueryStringComponents; } -NSArray * AFQueryStringComponentsFromKeyAndDictionaryValueWithEncoding(NSString *key, NSDictionary *value, NSStringEncoding stringEncoding){ +NSArray * AFQueryStringComponentsFromKeyAndDictionaryValue(NSString *key, NSDictionary *value){ NSMutableArray *mutableQueryStringComponents = [NSMutableArray array]; - [value enumerateKeysAndObjectsUsingBlock:^(id k, id v, BOOL *stop) { - [mutableQueryStringComponents addObjectsFromArray:AFQueryStringComponentsFromKeyAndValueWithEncoding((key ? [NSString stringWithFormat:@"%@[%@]", key, k] : k), v, stringEncoding)]; + [value enumerateKeysAndObjectsUsingBlock:^(id nestedKey, id nestedValue, BOOL *stop) { + [mutableQueryStringComponents addObjectsFromArray:AFQueryStringComponentsFromKeyAndValue((key ? [NSString stringWithFormat:@"%@[%@]", key, nestedKey] : nestedKey), nestedValue)]; }]; return mutableQueryStringComponents; } -NSArray * AFQueryStringComponentsFromKeyAndArrayValueWithEncoding(NSString *key, NSArray *value, NSStringEncoding stringEncoding) { +NSArray * AFQueryStringComponentsFromKeyAndArrayValue(NSString *key, NSArray *value) { NSMutableArray *mutableQueryStringComponents = [NSMutableArray array]; - [value enumerateObjectsUsingBlock:^(id v, NSUInteger idx, BOOL *stop) { - [mutableQueryStringComponents addObjectsFromArray:AFQueryStringComponentsFromKeyAndValueWithEncoding([NSString stringWithFormat:@"%@[]", key], v, stringEncoding)]; + [value enumerateObjectsUsingBlock:^(id nestedValue, NSUInteger idx, BOOL *stop) { + [mutableQueryStringComponents addObjectsFromArray:AFQueryStringComponentsFromKeyAndValue([NSString stringWithFormat:@"%@[]", key], nestedValue)]; }]; return mutableQueryStringComponents; @@ -496,8 +498,15 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) { NSMutableURLRequest *request = [self requestWithMethod:method path:path parameters:nil]; __block AFMultipartFormData *formData = [[AFMultipartFormData alloc] initWithStringEncoding:self.stringEncoding]; - for (AFQueryStringComponent *component in AFQueryStringComponentsFromKeyAndValueWithEncoding(nil, parameters, self.stringEncoding)) { - [formData appendPartWithFormData:[component.value dataUsingEncoding:self.stringEncoding] name:component.key]; + for (AFQueryStringComponent *component in AFQueryStringComponentsFromKeyAndValue(nil, parameters)) { + NSData *data = nil; + if ([component.value isKindOfClass:[NSData class]]) { + data = component.value; + } else { + data = [[component.value description] dataUsingEncoding:self.stringEncoding]; + } + + [formData appendPartWithFormData:data name:[component.key description]]; } if (block) { diff --git a/AFNetworking/AFHTTPRequestOperation.h b/AFNetworking/AFHTTPRequestOperation.h index 4b6a63e..3c7ed31 100644 --- a/AFNetworking/AFHTTPRequestOperation.h +++ b/AFNetworking/AFHTTPRequestOperation.h @@ -31,12 +31,7 @@ extern NSSet * AFContentTypesFromHTTPHeader(NSString *string); /** `AFHTTPRequestOperation` is a subclass of `AFURLConnectionOperation` for requests using the HTTP or HTTPS protocols. It encapsulates the concept of acceptable status codes and content types, which determine the success or failure of a request. */ -@interface AFHTTPRequestOperation : AFURLConnectionOperation { -@private - NSError *_HTTPError; - dispatch_queue_t _successCallbackQueue; - dispatch_queue_t _failureCallbackQueue; -} +@interface AFHTTPRequestOperation : AFURLConnectionOperation ///---------------------------------------------- /// @name Getting HTTP URL Connection Information diff --git a/AFNetworking/AFImageRequestOperation.h b/AFNetworking/AFImageRequestOperation.h index 7456d5f..7a7f78a 100644 --- a/AFNetworking/AFImageRequestOperation.h +++ b/AFNetworking/AFImageRequestOperation.h @@ -49,15 +49,7 @@ - `image/x-xbitmap` - `image/x-win-bitmap` */ -@interface AFImageRequestOperation : AFHTTPRequestOperation { -@private -#if __IPHONE_OS_VERSION_MIN_REQUIRED - UIImage *_responseImage; - CGFloat _imageScale; -#elif __MAC_OS_X_VERSION_MIN_REQUIRED - NSImage *_responseImage; -#endif -} +@interface AFImageRequestOperation : AFHTTPRequestOperation /** An image constructed from the response data. If an error occurs during the request, `nil` will be returned, and the `error` property will be set to the error. diff --git a/AFNetworking/AFImageRequestOperation.m b/AFNetworking/AFImageRequestOperation.m index 34a1fd6..3365a20 100644 --- a/AFNetworking/AFImageRequestOperation.m +++ b/AFNetworking/AFImageRequestOperation.m @@ -157,9 +157,7 @@ static dispatch_queue_t image_request_operation_processing_queue() { return; } - [self willChangeValueForKey:@"imageScale"]; _imageScale = imageScale; - [self didChangeValueForKey:@"imageScale"]; self.responseImage = nil; } diff --git a/AFNetworking/AFJSONRequestOperation.h b/AFNetworking/AFJSONRequestOperation.h index 7c6a579..a1191f9 100644 --- a/AFNetworking/AFJSONRequestOperation.h +++ b/AFNetworking/AFJSONRequestOperation.h @@ -35,11 +35,7 @@ @warning JSON parsing will automatically use JSONKit, SBJSON, YAJL, or NextiveJSON, if provided. Otherwise, the built-in `NSJSONSerialization` class is used, if available (iOS 5.0 and Mac OS 10.7). If the build target does not either support `NSJSONSerialization` or include a third-party JSON library, a runtime exception will be thrown when attempting to parse a JSON request. */ -@interface AFJSONRequestOperation : AFHTTPRequestOperation { -@private - id _responseJSON; - NSError *_JSONError; -} +@interface AFJSONRequestOperation : AFHTTPRequestOperation ///---------------------------- /// @name Getting Response Data diff --git a/AFNetworking/AFNetworkActivityIndicatorManager.h b/AFNetworking/AFNetworkActivityIndicatorManager.h index d15384a..4a5640c 100644 --- a/AFNetworking/AFNetworkActivityIndicatorManager.h +++ b/AFNetworking/AFNetworkActivityIndicatorManager.h @@ -30,12 +30,7 @@ /** `AFNetworkActivityIndicatorManager` manages the state of the network activity indicator in the status bar. When enabled, it will listen for notifications indicating that a network request operation has started or finished, and start or stop animating the indicator accordingly. The number of active requests is incremented and decremented much like a stack or a semaphore, and the activity indicator will animate so long as that number is greater than zero. */ -@interface AFNetworkActivityIndicatorManager : NSObject { -@private - NSInteger _activityCount; - BOOL _enabled; - NSTimer *_activityIndicatorVisibilityTimer; -} +@interface AFNetworkActivityIndicatorManager : NSObject /** A Boolean value indicating whether the manager is enabled. @@ -44,6 +39,11 @@ */ @property (nonatomic, assign, getter = isEnabled) BOOL enabled; +/** + A Boolean value indicating whether the network activity indicator is currently displayed in the status bar. + */ +@property (readonly, nonatomic, assign) BOOL isNetworkActivityIndicatorVisible; + /** Returns the shared network activity indicator manager object for the system. diff --git a/AFNetworking/AFNetworkActivityIndicatorManager.m b/AFNetworking/AFNetworkActivityIndicatorManager.m index a376d81..01a6851 100644 --- a/AFNetworking/AFNetworkActivityIndicatorManager.m +++ b/AFNetworking/AFNetworkActivityIndicatorManager.m @@ -23,6 +23,7 @@ #import "AFNetworkActivityIndicatorManager.h" #import "AFHTTPRequestOperation.h" +#import #if __IPHONE_OS_VERSION_MIN_REQUIRED static NSTimeInterval const kAFNetworkActivityIndicatorInvisibilityDelay = 0.25; @@ -56,7 +57,7 @@ static NSTimeInterval const kAFNetworkActivityIndicatorInvisibilityDelay = 0.25; if (!self) { return nil; } - + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(incrementActivityCount) name:AFNetworkingOperationDidStartNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(decrementActivityCount) name:AFNetworkingOperationDidFinishNotification object:nil]; @@ -72,11 +73,7 @@ static NSTimeInterval const kAFNetworkActivityIndicatorInvisibilityDelay = 0.25; [super dealloc]; } -- (void)setActivityCount:(NSInteger)activityCount { - [self willChangeValueForKey:@"activityCount"]; - _activityCount = MAX(activityCount, 0); - [self didChangeValueForKey:@"activityCount"]; - +- (void)updateNetworkActivityIndicatorVisibilityDelayed { if (self.enabled) { // Delay hiding of activity indicator for a short interval, to avoid flickering if (![self isNetworkActivityIndicatorVisible]) { @@ -90,23 +87,41 @@ static NSTimeInterval const kAFNetworkActivityIndicatorInvisibilityDelay = 0.25; } - (BOOL)isNetworkActivityIndicatorVisible { - return self.activityCount > 0; + return _activityCount > 0; } - (void)updateNetworkActivityIndicatorVisibility { - [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:[self isNetworkActivityIndicatorVisible]]; + dispatch_async(dispatch_get_main_queue(), ^{ + [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:[self isNetworkActivityIndicatorVisible]]; + }); +} + +// Not exposed, but used if activityCount is set via KVC. +- (void)setActivityCount:(NSInteger)activityCount { + __sync_swap(&_activityCount, activityCount); + [self updateNetworkActivityIndicatorVisibilityDelayed]; } - (void)incrementActivityCount { - @synchronized(self) { - self.activityCount += 1; - } + [self willChangeValueForKey:@"activityCount"]; + OSAtomicIncrement32((int32_t*)&_activityCount); + [self didChangeValueForKey:@"activityCount"]; + [self updateNetworkActivityIndicatorVisibilityDelayed]; } - (void)decrementActivityCount { - @synchronized(self) { - self.activityCount -= 1; - } + [self willChangeValueForKey:@"activityCount"]; + bool success; + do { + int32_t currentCount = _activityCount; + success = OSAtomicCompareAndSwap32(currentCount, MIN(currentCount - 1, currentCount), &_activityCount); + } while(!success); + [self didChangeValueForKey:@"activityCount"]; + [self updateNetworkActivityIndicatorVisibilityDelayed]; +} + ++ (NSSet *)keyPathsForValuesAffectingIsNetworkActivityIndicatorVisible { + return [NSSet setWithObject:@"activityCount"]; } @end diff --git a/AFNetworking/AFPropertyListRequestOperation.h b/AFNetworking/AFPropertyListRequestOperation.h index 150041c..aa6e471 100644 --- a/AFNetworking/AFPropertyListRequestOperation.h +++ b/AFNetworking/AFPropertyListRequestOperation.h @@ -32,13 +32,7 @@ - `application/x-plist` */ -@interface AFPropertyListRequestOperation : AFHTTPRequestOperation { -@private - id _responsePropertyList; - NSPropertyListFormat _propertyListFormat; - NSPropertyListReadOptions _propertyListReadOptions; - NSError *_propertyListError; -} +@interface AFPropertyListRequestOperation : AFHTTPRequestOperation ///---------------------------- /// @name Getting Response Data diff --git a/AFNetworking/AFURLConnectionOperation.h b/AFNetworking/AFURLConnectionOperation.h index 88f717a..ea69fe8 100644 --- a/AFNetworking/AFURLConnectionOperation.h +++ b/AFNetworking/AFURLConnectionOperation.h @@ -75,23 +75,7 @@ extern NSString * const AFNetworkingOperationDidFinishNotification; @warning Attempting to load a `file://` URL in iOS 4 may result in an `NSInvalidArgumentException`, caused by the connection returning `NSURLResponse` rather than `NSHTTPURLResponse`, which is the behavior as of iOS 5. */ -@interface AFURLConnectionOperation : NSOperation { -@private - signed short _state; - BOOL _cancelled; - NSRecursiveLock *_lock; - - NSSet *_runLoopModes; - - NSURLConnection *_connection; - NSURLRequest *_request; - NSHTTPURLResponse *_response; - NSError *_error; - - NSData *_responseData; - long long _totalBytesRead; - NSOutputStream *_outputStream; -} +@interface AFURLConnectionOperation : NSOperation ///------------------------------- /// @name Accessing Run Loop Modes diff --git a/AFNetworking/AFURLConnectionOperation.m b/AFNetworking/AFURLConnectionOperation.m index 669a20a..2b60952 100644 --- a/AFNetworking/AFURLConnectionOperation.m +++ b/AFNetworking/AFURLConnectionOperation.m @@ -89,6 +89,7 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat @interface AFURLConnectionOperation () @property (readwrite, nonatomic, assign) AFOperationState state; +@property (readwrite, nonatomic, assign, getter = isCancelled) BOOL cancelled; @property (readwrite, nonatomic, retain) NSRecursiveLock *lock; @property (readwrite, nonatomic, retain) NSURLConnection *connection; @property (readwrite, nonatomic, retain) NSURLRequest *request; @@ -109,6 +110,7 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat @implementation AFURLConnectionOperation @synthesize state = _state; +@synthesize cancelled = _cancelled; @synthesize connection = _connection; @synthesize runLoopModes = _runLoopModes; @synthesize request = _request; @@ -351,10 +353,6 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat return self.state == AFHTTPOperationFinishedState; } -- (BOOL)isCancelled { - return _cancelled; -} - - (BOOL)isConcurrent { return YES; } diff --git a/AFNetworking/AFXMLRequestOperation.h b/AFNetworking/AFXMLRequestOperation.h index 7fa919d..0beb677 100644 --- a/AFNetworking/AFXMLRequestOperation.h +++ b/AFNetworking/AFXMLRequestOperation.h @@ -39,14 +39,7 @@ When `AFXMLRequestOperation` is registered with `AFHTTPClient`, the response object in the success callback of `HTTPRequestOperationWithRequest:success:failure:` will be an instance of `NSXMLParser`. On platforms that support `NSXMLDocument`, you have the option to ignore the response object, and simply use the `responseXMLDocument` property of the operation argument of the callback. */ -@interface AFXMLRequestOperation : AFHTTPRequestOperation { -@private - NSXMLParser *_responseXMLParser; -#if __MAC_OS_X_VERSION_MIN_REQUIRED - NSXMLDocument *_responseXMLDocument; -#endif - NSError *_XMLError; -} +@interface AFXMLRequestOperation : AFHTTPRequestOperation ///---------------------------- /// @name Getting Response Data diff --git a/AFNetworking/UIImageView+AFNetworking.m b/AFNetworking/UIImageView+AFNetworking.m index 9f9d190..5310e71 100644 --- a/AFNetworking/UIImageView+AFNetworking.m +++ b/AFNetworking/UIImageView+AFNetworking.m @@ -28,8 +28,8 @@ @interface AFImageCache : NSCache - (UIImage *)cachedImageForRequest:(NSURLRequest *)request; -- (void)cacheImageData:(NSData *)imageData - forRequest:(NSURLRequest *)request; +- (void)cacheImage:(UIImage *)image + forRequest:(NSURLRequest *)request; @end #pragma mark - @@ -121,7 +121,7 @@ static char kAFImageRequestOperationObjectKey; success(operation.request, operation.response, responseObject); } - [[[self class] af_sharedImageCache] cacheImageData:operation.responseData forRequest:urlRequest]; + [[[self class] af_sharedImageCache] cacheImage:responseObject forRequest:urlRequest]; self.af_imageRequestOperation = nil; } failure:^(AFHTTPRequestOperation *operation, NSError *error) { @@ -162,18 +162,13 @@ static inline NSString * AFImageCacheKeyFromURLRequest(NSURLRequest *request) { break; } - UIImage *image = [UIImage imageWithData:[self objectForKey:AFImageCacheKeyFromURLRequest(request)]]; - if (image) { - return [UIImage imageWithCGImage:[image CGImage] scale:[[UIScreen mainScreen] scale] orientation:image.imageOrientation]; - } - - return image; + return [self objectForKey:AFImageCacheKeyFromURLRequest(request)]; } -- (void)cacheImageData:(NSData *)imageData - forRequest:(NSURLRequest *)request +- (void)cacheImage:(UIImage *)image + forRequest:(NSURLRequest *)request { - [self setObject:[NSPurgeableData dataWithData:imageData] forKey:AFImageCacheKeyFromURLRequest(request)]; + [self setObject:image forKey:AFImageCacheKeyFromURLRequest(request)]; } @end diff --git a/README.md b/README.md index e4adbe1..a339a43 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,6 @@ Scott Raymond - http://github.com/sco - http://twitter.com/sco -- sco@gowalla.com ## License diff --git a/iOS Example/Classes/Controllers/PublicTimelineViewController.m b/iOS Example/Classes/Controllers/PublicTimelineViewController.m index 8da1159..966b607 100644 --- a/iOS Example/Classes/Controllers/PublicTimelineViewController.m +++ b/iOS Example/Classes/Controllers/PublicTimelineViewController.m @@ -42,8 +42,10 @@ self.navigationItem.rightBarButtonItem.enabled = NO; [Tweet publicTimelineTweetsWithBlock:^(NSArray *tweets) { - _tweets = tweets; - [self.tableView reloadData]; + if (tweets) { + _tweets = tweets; + [self.tableView reloadData]; + } [_activityIndicatorView stopAnimating]; self.navigationItem.rightBarButtonItem.enabled = YES; diff --git a/iOS Example/Classes/Models/Tweet.m b/iOS Example/Classes/Models/Tweet.m index f53359d..d6bc1ec 100644 --- a/iOS Example/Classes/Models/Tweet.m +++ b/iOS Example/Classes/Models/Tweet.m @@ -65,6 +65,12 @@ } } failure:^(AFHTTPRequestOperation *operation, NSError *error) { NSLog(@"Error: %@", error); + + [[[UIAlertView alloc] initWithTitle:@"Error" message:[error localizedDescription] delegate:nil cancelButtonTitle:nil otherButtonTitles:@"Ok", nil] show]; + + if (block) { + block(nil); + } }]; } diff --git a/iOS Example/Classes/Views/TweetTableViewCell.m b/iOS Example/Classes/Views/TweetTableViewCell.m index 6fee1c0..f44c1f9 100644 --- a/iOS Example/Classes/Views/TweetTableViewCell.m +++ b/iOS Example/Classes/Views/TweetTableViewCell.m @@ -50,9 +50,7 @@ } - (void)setTweet:(Tweet *)tweet { - [self willChangeValueForKey:@"tweet"]; _tweet = tweet; - [self didChangeValueForKey:@"tweet"]; self.textLabel.text = _tweet.user.username; self.detailTextLabel.text = _tweet.text;