Skip to content

Commit

Permalink
Merge pull request #203 from artsy/alloy-try-to-fix-crash
Browse files Browse the repository at this point in the history
@orta => Tries to fix #103 and various related tickets.
  • Loading branch information
orta committed Feb 19, 2015
2 parents 22b8671 + 0e06018 commit fc148a2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions Artsy/Classes/View Controllers/ARArtworkViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ - (UIImageView *)imageView

- (void)viewDidAppear:(BOOL)animated
{
self.view.delegate = self;
self.view.metadataView.delegate = self;
self.view.artworkBlurbView.delegate = self;
self.postsVC.delegate = self;

// When we get back from zoom / VIR allow the preview to do trigger zoom
self.view.metadataView.userInteractionEnabled = YES;
[super viewDidAppear:self.shouldAnimate && animated];
Expand All @@ -95,6 +100,13 @@ - (void)viewDidDisappear:(BOOL)animated
[self.view.relatedArtworksView cancel];
self.view.scrollsToTop = NO;

// See https://github.com/artsy/eigen/issues/103
self.view.delegate = nil;
// And nill-ify these as well, for good measure.
self.view.metadataView.delegate = nil;
self.view.artworkBlurbView.delegate = nil;
self.postsVC.delegate = nil;

[super viewDidDisappear:self.shouldAnimate && animated];
}

Expand Down
2 changes: 1 addition & 1 deletion Artsy/Classes/Views/ARArtworkView.m
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ - (void)setUpCallbacks
}];

[self.artwork onFairUpdate:^(Fair *fair) {
@strongify(self);
if (!self) return;

@strongify(self);
[self.metadataView updateWithFair:fair];
[self.stackView layoutIfNeeded];
} failure:nil];
Expand Down

0 comments on commit fc148a2

Please sign in to comment.