Problems and solutions for swift IOS development

Source: Internet
Author: User

Recently began to learn iOS development, and today followed the Stanford public class to write the calculator code encountered the following error:

2015-03-15 20:18:18.442 calculater[1185:66564]-[calculater. Viewcontroller operator:]: Unrecognized selector sent to instance 0x7ffb1875b220

2015-03-15 20:18:18.453 calculater[1185:66564] * * * terminating app due to uncaught exception ' Nsinvalidargumentexception ', Reason: '-[calculater. Viewcontroller operator:]: Unrecognized selector sent to instance 0x7ffb1875b220 '

First throw Call stack:

... ... (Omitted here)

Libc++abi.dylib:terminating with uncaught exception of type NSException

After discovering the error I have been with the video on the code is relatively different, the code is not very big difference, the Internet to check that the source of the error can be seen from this: [Calculater. Viewcontroller Operator:]

And then I was looking for "operator", but I didn't define "operator" in my Code.

Finally, I found that when I first declared the button's action, I defined the action named operator, but then operator is the keyword, I cannot use it, and after I redefine the name of the action, the action of the button is still bound to a "operator". After you delete this binding, the program will run normally.

Problems and solutions for swift IOS development

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.