iOS Early Master

Source: Internet
Author: User

Core: Classes and Objects
Features: encapsulation, inheritance, polymorphism
OC
is a full-dynamic language
Pros: reusability, scalability
Class: Abstraction of something with the same characteristics and behavior
Object is an instance of a class
Class is the type of object
Interface part: Characteristics and behavior of the foreign Declaration class
Implementation part: Internal implementation behavior

cannot write instance variable in class method
Instance methods can only use object invocation

class Name: All words are capitalized in the first letter. GoodStudent.h

Object Name: Follow the Hump naming method. goodstudent;

method Name: Each parameter's modifiers are followed by the hump nomenclature. initWithName:withAge:withAddress

instance variable: follows the Hump naming method, but needs to be underlined before the variable name. _name;

parameter type: Follow the Hump naming method, do not add underscores. newName

Isa , is the first instance variable of all classes, which is used to get the information of the class: class name, pointer to parent class, method list, method corresponding function address, etc.

Super
Action: sending a message to super is invoking an instance method inherited from the parent class (called from this class)

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.