Dark Horse Programmer---iOS learning log 11

Source: Internet
Author: User

------<a href= "http://www.itheima.com" target= "blank" >java training, Android training, iOS training,. NET training </a>, look forward to communicating with you! -------

1, facing the

Object-oriented Oo, there is no unified concept, broadly defined as: according to people to understand the objective world of system thinking mode, the use of object-based (entity) concept to establish a model, simulation of the objective world analysis, design, implementation of software methods. Through the object-oriented concept, the computer software system can correspond with the real-world system one by one.

Advantages: Greatly improve the success rate of software projects

Reduced maintenance costs

Increased portability and reliability

Object-oriented three main features:

Encapsulation of

Polymorphism

Inheritance of

2. Classes and objects

A class is a collection of entities with similar internal states and motion laws.

Object refers to a variety of entities in the real world, it can refer to specific things can also refer to abstract things.

The method of abstracting things from everyday life into classes: the extraction of nouns

The definition of a class in OC has two parts: the declaration of the class and the implementation of the class.

Class declarations use keywords: @interface and @end

Class implementations use keywords: @implementation and @end

The Declaration and implementation of a method must begin with a + or-

+ denotes class method (static method)

-Represents an object method (dynamic method)

There are 3 common scope of member variables:

@public can be accessed globally

@protected can only be accessed within the class and within subclasses

@private can only be accessed within the class

Declaration implementation syntax for a class

Statement:

@interface Class Name: Parent class name

{

Class properties

}

Class behavior

@end

Realize:

@implementation class Name

Class properties

@end

Dark Horse Programmer---iOS learning log 11

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.