Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7543861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:32:14+00:00 2026-05-30T08:32:14+00:00

Have tried to compile and run this program, but have received this error message

  • 0

Have tried to compile and run this program, but have received this error message in the console:

2012-02-23 11:43:53.949 touches_v3[8667:f803] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ViewController 0x6aab1e0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key buttonShrink.'
*** First throw call stack:
(0x13bc052 0x154dd0a 0x13bbf11 0x9b3032 0x924f7b 0x924eeb 0x93fd60 0x23291a 0x13bde1a 0x1327821 0x23146e 0xd8e2c 0xd93a9 0xd95cb 0x39a73 0x39ce2 0x39ea8 0x40d9a 0x1f3b 0x119d6 0x128a6 0x21743 0x221f8 0x15aa9 0x12a6fa9 0x13901c5 0x12f5022 0x12f390a 0x12f2db4 0x12f2ccb 0x122a7 0x13a9b 0x1c42 0x1bb5)
terminate called throwing an exception(lldb) 

This doesn’t make sense to me because while I did code “buttonShrink” as an object in the header file, I later deleted it, and deleted all references to it in the implementation file. There are no errors or warnings in either the header or implementation files.

Here is the code for those two.
Header file:

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController {

    IBOutlet UIImageView *myIcon;
    IBOutlet UIImageView *myBackground;
    IBOutlet UIButton *shrinkButton;

    NSArray *bgImages;
    int currentBackground;
    bool hasMoved;
    bool hasShrunk;

    CGAffineTransform translate;
    CGAffineTransform size;
    UIButton *move;

}

@property (nonatomic, retain)UIImageView *myIcon; 
@property (nonatomic, retain)UIImageView *myBackground;
@property (nonatomic, retain)NSArray *bgImages;
@property (nonatomic, retain)UIButton *shrinkButton;


- (IBAction)shrink:(id)sender;
- (IBAction)move:(id)sender;
- (IBAction)change:(id)sender;

@end

Implementation file:

#import "ViewController.h"

@interface ViewController ()


@end

@implementation ViewController
@synthesize myIcon, myBackground, bgImages, shrinkButton;

- (void)viewDidLoad
{
    [super viewDidLoad];
hasMoved = NO;
    hasShrunk = NO;
    currentBackground = 0;

bgImages = [[NSArray alloc] initWithObjects:
            [UIImage imageNamed:@"wallPaper_01.png"],
             [UIImage imageNamed:@"wallPaper_02.png"],
             [UIImage imageNamed:@"wallPaper_03.png"],
             [UIImage imageNamed:@"wallPaper_04.png"],
             [UIImage imageNamed:@"wallPaper_05.png"],
             nil];


size = CGAffineTransformMakeScale(.25, .25);
    translate = CGAffineTransformMakeTranslation(0, -100);

myBackground.image = [bgImages objectAtIndex:currentBackground];

}

- (void)viewDidUnload
{
    [super viewDidUnload];

}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}

- (void)dealloc {
    [myIcon release];
    [myBackground release];
    [shrinkButton release];
    [super dealloc];
}

- (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
    UITouch *touch = [[event allTouches] anyObject];
    if (CGRectContainsPoint([myIcon frame], [touch locationInView:nil]))
    {
        if(hasMoved == YES && hasShrunk == YES) {
            myIcon.transform = CGAffineTransformTranslate(size, 0, 0);
            hasMoved = 0;
        }
        if(hasMoved == YES && hasShrunk == NO) {
            myIcon.transform = CGAffineTransformMakeTranslation(0, 0);
            hasMoved = NO;
        }

        myIcon.center = [touch locationInView:nil];
    }
}
- (IBAction)shrink:(id)sender {
    if (hasShrunk) {
        [shrinkButton setTitle:@"Shrink" forState:UIControlStateNormal];
    } else {
        [shrinkButton setTitle:@"Grow" forState:UIControlStateNormal];

    }

    if (hasShrunk == NO && hasMoved == NO) {
        [UIView beginAnimations:nil context:NULL];
        [UIView setAnimationDuration:1.0];
        myIcon.transform = size;
        [UIView commitAnimations];
        hasShrunk = YES;
    }

    else if (hasShrunk == NO && hasMoved == YES) {
        [UIView beginAnimations:nil context:NULL];
        [UIView setAnimationDuration:1.0];
        myIcon.transform = CGAffineTransformScale(translate, .25, .25);
        [UIView commitAnimations];
        hasShrunk = YES;
    }

    else if (hasShrunk == YES && hasMoved == YES) {
        [UIView beginAnimations:nil context:NULL];
        [UIView setAnimationDuration:1.0];
        myIcon.transform = CGAffineTransformScale(translate, 1, 1);
        [UIView commitAnimations];
        hasShrunk = YES;
    }

    if (hasShrunk == NO && hasMoved == NO) {
        [UIView beginAnimations:nil context:NULL];
        [UIView setAnimationDuration:1.0];
        myIcon.transform = CGAffineTransformIdentity;
        [UIView commitAnimations];
        hasShrunk = YES;
    }

}

- (IBAction)move:(id)sender {

    if (hasMoved == NO && hasShrunk == NO) {
        [UIView beginAnimations:nil context:NULL];
        [UIView setAnimationDuration:1.0];
        myIcon.transform = translate;
        [UIView commitAnimations];
        hasMoved = YES;
    }

    else if (hasMoved == NO && hasShrunk == YES) {
        [UIView beginAnimations:nil context:NULL];
        [UIView setAnimationDuration:1.0];
        myIcon.transform = CGAffineTransformTranslate(size, 0, -100);
        [UIView commitAnimations];
        hasMoved = YES;
    }

    else if (hasMoved == YES && hasShrunk == YES) {
        [UIView beginAnimations:nil context:NULL];
        [UIView setAnimationDuration:1.0];
        myIcon.transform = CGAffineTransformTranslate(size, 0, 0);
        [UIView commitAnimations];
        hasMoved = YES;
    }

    if (hasMoved == NO && hasShrunk == NO) {
        [UIView beginAnimations:nil context:NULL];
        [UIView setAnimationDuration:1.0];
        myIcon.transform = CGAffineTransformMakeTranslation(0,0);
        [UIView commitAnimations];
        hasMoved = YES;
    }

}

- (IBAction)change:(id)sender {
    currentBackground++;
    if (currentBackground >=[bgImages count])
    currentBackground = 0;

    [UIView beginAnimations:@"changeView" context:nil];
    [UIView setAnimationDuration:1];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];

    if (currentBackground == 1) {
        [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view cache:YES];
    }

    if (currentBackground == 2) {
        [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view cache:YES];
    }

    if (currentBackground == 3) {
        [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES];
    }

    if (currentBackground == 4) {
        [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES];
    }

    [UIView commitAnimations];
    myBackground.image = [bgImages objectAtIndex:currentBackground];
}
@end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:32:16+00:00Added an answer on May 30, 2026 at 8:32 am

    You have a button in InterfaceBuider that is linked to an action called “buttonShrink”. Looks like you probably renamed the method in your class, but did not update the association in InterfaceBuilder.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tried this... Dim myMatches As String() = System.Text.RegularExpressions.Regex.Split(postRow.Item(Post), \b\#\b) But it is
Autoconf has gotten me stumped. I have tried modifying the COMPILE in Makefile.in as
I have tried to integrate the Picasa API on iPhone, compiles fine, but I
I have tried to find how to create DLL-s on linux using google, but
I have tried different examples to filter a gridview by dropdownlist, but is it
I have a piece of templated code that is never run, but is compiled.
I'm trying to run a GLSL example , but I can't. The error is
I'm trying to start a C++ Qt application and have it run and compile
I am getting this error while running a hadoop pipes program. The program compiles
I have taken the task of trying to get an older program to run

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.