About iOS8 Stanford Open Class lesson two

Source: Internet
Author: User

In this lesson, we ran into code like this.

    @IBAction func oprate (Sender:uibutton) {let        opration = sender.currenttitle!        If Userisoninput {            enter ()        }        switch opration {case        ' + ': performoperation{$0+$1} case                    "−": performoperation{$1-$0} case        ' x ': performoperation{$0*$1} case        ' ÷ ': performoperation{$1/$0}//case        ' √ ' : performoperation{sqrt ($)}        default:break        }                    }    func performoperation (opretion: (double,double ) (Double) {        if Operandstack.count >= 2 {            displayvalue = opretion (Operandstack.removelast (), Operandstack.removelast ())            enter ()        }    }        /** does not have the overload of the closure parameter  *///    func performoperation ( Opretion:double, Double) {//        if Operandstack.count >= 1 {//            Displayvalue = Opretion ( Operandstack.removelast ())//            Enter ()//        }//    }

The video is running a variety of jouissance, but we are not compiling the past ...

Comment Error: The answer was found in stack overflow: Because the swift language supports overloading, the OC language does not support overloading!

In other words, where do I relate to OC? This is obviously swift ... Take a closer look and discover that Uiviewcontroller is inherited from NSObject ...

It may be that Paul Hegarty is using a lower version of Xcode, so he doesn't encounter

About iOS8 Stanford Open Class lesson two

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.