Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code is crashing when trying to call the selector #23

Open
tdahbura opened this issue Aug 17, 2012 · 0 comments
Open

Code is crashing when trying to call the selector #23

tdahbura opened this issue Aug 17, 2012 · 0 comments

Comments

@tdahbura
Copy link

[self.switch1 addTarget:self action:@selector(switch1Toggled:) forControlEvents:UIControlEventValueChanged];

When this line is enabled in the code and you click on the switch it crashes in the simulator to assembly code, once the debugger dropped a message that an invalid selector was being called.

This was the code for the selector:

  • (void)switch1Toggled:(id)sender
    {
    [switch2 setOn:!switch2.isOn animated:YES];
    }

I am using Xcode 4.4.1 with iOS 5.1 simulator.

Here is a dump log:
2012-08-17 19:37:41.565 DCRoundSwitchDemo[1654:c07] -[__NSCFString switch1Toggled:]: unrecognized selector sent to instance 0x6a8f580
2012-08-17 19:37:41.568 DCRoundSwitchDemo[1654:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString switch1Toggled:]: unrecognized selector sent to instance 0x6a8f580'
*** First throw call stack:
(0x1379022 0x106ecd6 0x137acbd 0x12dfed0 0x12dfcb2 0x137ae99 0x1d414e 0x1d40e6 0x27aade 0x27afa7 0x27ab13 0x754e 0x2128330 0x212a509 0x12b0803 0x12afd84 0x12afc9b 0x21847d8 0x218488a 0x1d1626 0x2bdd 0x2b55 0x1)
terminate called throwing an exception(lldb)

I am getting this if two buttons are pointing to the same selector, or it appears by simply adding a new button with a new selector....All this work is in the sample app that comes with the kit.

Thanks,
Tony

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant