------<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