Objective-C permission Control

Source: Internet
Author: User

Whether the two methods are the same in OC, regardless of the parameter type and return value. The sum of the methods is related to the method name.

For example, in the same fatigue in OC, this function form is incorrect.

-(Void) theage :( INT) Age name :( nsstring *) Name

-(Nsstring *) theage :( INT) Age name :( nsstring *) Name

The syntax rules inherited by oC are:

@ Interface subclass: parent class

Permission control:

Any place inside the modifier class subclass

Private
Yes

Protected
Yes Yes

Public
Yes YesYes

Several methods related to classes:

-(Bool) iskindofclass :( class) Aclass; is the object a member or subclass of Aclass?

-(Bool) ismemberofclass :( class) Aclass; whether the object is an Aclass Member

-(Bool) issubclassofclass :( class) Aclass; is the object a subclass of Aclass?

-(Bool) respondstoselector :( SEL) aselector; whether the object can respond to the method specified by aselector

-(ID) performselector: (SEL) aselector; the object calls the method specified by aselector.

-(ID) specify mselector :( SEL) aselector withobject :( ID) object; the object calls the method specified by aselector and passes the parameter object

-(ID) specify mselector :( SEL) aselector withobject :( ID) object1 withobject :( ID) object2; gambling Xia ing calls the method specified by aselector and passes the object1 and object2 Parameters

Related Article

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.