Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Perform removeObserver in property(topics) setter

  • Loading branch information...
commit 33613167b8ec089563f26a04f53707a97b88ced5 1 parent 0e1b197
@winfield authored
Showing with 10 additions and 1 deletion.
  1. +10 −1 Ruby China/RCITopicViewController.m
View
11 Ruby China/RCITopicViewController.m
@@ -32,6 +32,16 @@ - (NSMutableArray *)observedVisibleItems
return _observedVisibleItems;
}
+- (void)setTopics:(NSArray *)topics
+{
+ for (RCITopic *topic in _topics) {
+ if ([self.observedVisibleItems containsObject:topic.user]) {
+ [topic removeObserver:self forKeyPath:RCITopicPropertyNamedGravatar];
+ }
+ }
+ _topics = topics;
+}
+
- (void)viewDidLoad
{
[super viewDidLoad];
@@ -60,7 +70,6 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface
- (void)objectLoader:(RKObjectLoader*)objectLoader didLoadObjects:(NSArray *)objects {
self.topics = [objects copy];
- NSLog(@"KKKKKK");
[self.topicTableView reloadData];
[self stopLoading];
}
Please sign in to comment.
Something went wrong with that request. Please try again.