Scenario: User is viewing a screen with an image and some accompanying text in labels. User taps image and is brought to a screen that has the image only, and it needs to be zoomable. User taps that image and is brought back to the image/text screen.
Using storyboards I have implemented the first screen with
@interface FirstImageViewController : UIViewController <UIScrollViewDelegate>
That works. (btw though, I do not have zoom working on this screen)
I implemented the second screen with
@interface SecondImageViewController : UIViewController <UIScrollViewDelegate>
I tried to segue to the second screen with:
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
[self performSegueWithIdentifier:@"SingleImage" sender:touch];
return YES;
and
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
self.secondImageViewController = segue.destinationViewController;
[self.secondImageViewController setImageToDisplay:self.imageToDisplay];
}
but get an error on the gestureRecognizer method:
* Terminating app due to uncaught exception ‘NSUnknownKeyException’, reason: ‘[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key imageDisplayer.’
I am not sure I am going about this the right way and could use help.
Rick
That error message is most often a symptom of a problem in your UI (whether xib or storyboard) where a view controller and its associated views are being loaded and there’s a reference to an outlet that doesn’t exist in code. Do you have a link in your storyboard to something called
imageDisplayer?(If you don’t see it, try right-clicking on your storyboard and choosing “Open As->Source Code” and doing a text search.)