Benches Uncategorized

6

Terminating app due to uncaught exception…

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

I have a nib file with following objects name and types.

File's Owner----UIViewController

First Responder-----UIResponder

InputView-----UIView

InputController-----InputController

In the input view I have several UIButton and UILabel and one UISlider. InputController is basically the controller class which has outlets to the buttons and labels and has the actions methods defined for various events of button and slider. The following is my InputController class written by the Interface Builder


#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
@interface InputController : NSObject {
IBOutlet UIButton *button1;
IBOutlet UIButton *clearAllButton;
IBOutlet UIButton *copyButton;
IBOutlet UISlider *extraSlider;
IBOutlet UILabel *label1;
IBOutlet UIButton *button2;
IBOutlet UILabel *label2;
IBOutlet UIButton *button3;
IBOutlet UIButton *button4;
IBOutlet UIButton *button5;
IBOutlet UILabel *label3;
IBOutlet UILabel *label4;
}
- (IBAction)calc1;
- (IBAction)calc2;
- (IBAction)calc3;
- (IBAction)calc4;
- (IBAction)chooseFrequency;
- (IBAction)extraSliderMoved;
@end

and here is the implementation


#import "InputController.h"
@implementation InputController
- (IBAction)calc1 {

}
- (IBAction)calc2 {

}
- (IBAction)calc3 {

}
- (IBAction)calc4 {

}
- (IBAction)chooseFrequency {

}
- (IBAction)extraSliderMoved {

}
@end

Now, in the simulator when I tap on any of the buttons, my application crashes with the following log

<pre>

2009-01-05 16:13:01.925 Calc[1323:20b]
* -[NSCFSet calc1]: unrecognized selector sent to

instance 0x452630

2009-01-05 16:13:01.926 Calc[1323:20b]
* Terminating app due to uncaught exception

'NSInvalidArgumentException', reason: '
* -[NSCFSet calc1]: unrecognized selector sent to instance

0x452630'

2009-01-05 16:13:01.927 Calc[1323:20b] Stack: (

2453877067,

2484776507,

2453906250,

2453899596,

2453899794,

816177758,

816558114,

816559338,

816556080,

816274443,

816209415,

816206378,

829003042,

829012108,

2453378581,

2453380344,

829005112,

829005309,

816175835,

816221412,

10280,

10134

)

[Session started at 2009-01-05 16:13:01 +0530.]

Loading program into debugger…

GNU gdb 6.3.50-20050815 (Apple version gdb-962) (Sat Jul 26 08:14:40 UTC 2008)

Copyright 2004 Free Software Foundation, Inc.

GDB is free software, covered by the GNU General Public License, and you are

welcome to change it and/or distribute copies of it under certain conditions.

Type "show copying" to see the conditions.

There is absolutely no warranty for GDB. Type "show warranty" for details.

</pre>

I am a newbie, can someone please help me fixing this issue?

Thanks!

6 replies

Sign in or join Beachball Help to reply.

  1. 0

    vavdiyaharesh

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Hi mithin,

    I think that u haven't proper;y connect outlet and action method and that why u get error when u will press b utton calc1... right?

    So u should connect button and IBAction method..... try it out.

    Thanks,

    Haresh.

  2. 0

    mithin

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I have connected the button and the action. I can see the connection.

  3. 0

    vavdiyaharesh

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    ok then try

    -(IBAction)calc1:(id)sender{
    }

    instead of only -(IBAction) and again connect ur iboutlet.........

  4. 0

    mithin

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    No. Still the same. I modified the function and then I read the new class file in the Interface Builder and reconnected the action to the outlet but the application still crashes when I tap on the button.

  5. 0

    vavdiyaharesh

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    hi,

    send this code on [email protected] i want to solve this problem.

  6. 0

    vavdiyaharesh

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    can u terll me in which version of mac os and iphone sdk are using?