Self-study Ios:second day objective-c

Source: Internet
Author: User

OC is a superset of C, extended from C, with object-oriented features such as classes, messages, and single inheritance.

Part of C:

Data type:

Short,int,long,float,double,char,pointer,struct

Common methods:

ReadLine ()

Atoi ()

sizeof ()

malloc ()


Part of OC:

Receiver:classnameorobject

Selector:method

Message delivery is achieved through [receiver selector],

Eg:nsdate *now = [NSDate Date];


-:instance method, Entity methods, depends on an instance of a class;

+:class method, class methods, Java-like static methods.


Instance variable start with an Understore:such as _name.


Multi-parameter method invocation:

[Receiver Selector:argoneval Argtwoname:argtwoval argthreename:argthreeval ... ]


ID: Eg:id delegate when unsure what type of object it is pointing to;

Note the ID type of the variable is preceded by an * number.

This article is from the "Phoenixisland" blog, make sure to keep this source http://phoenix2012.blog.51cto.com/1799358/1430957

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.