Like to read some Open-source project source, always will find that the great God's code always have some short and efficient macro definition, click to see, find obscure, not to mention learning, sometimes understanding is a difficult, but the
Chapter No. 04 Types and dynamic binding of objects
An important feature of OBJECTIVE-C is its dynamic nature, which describes the dynamic type of objective-c, dynamic typing, and dynamically binding.
4.1 Dynamic Binding
4.1.1 What is dynamic
Three types of timers in OC: Cadisplaylink, Nstimer, GCDLet's take a look at Cadiskplaylink, go inside the header file, and use a note to illustrate the following.@interfacecadisplaylink:nsobject{@private void*_impl; pointer}+ (Cadisplaylink *)
Original address: http://onevcat.com/2013/05/talk-about-warning/
A moral integrity programmer cares about the warning of his code, just like a dead cockroach on the edge of a job. --@onevcat
Attention to compilation warningsThe
IntroductionThe Objective-c language uses reference counts to manage memory, that is, each object has a counter that can be incremented or decremented. If you want to keep an object alive, increment its reference count, and after it is exhausted, it
First, the Protocol protocol is mainly to provide interface, or similar to C + + multiple inheritance function, to provide a cosmetic mechanism for the class. The protocol is not born for callbacks, it should represent a set of interop conventions.
In Objective-c, defining a class requires two parts: the first is the interface (interface), and the second is the implementation (implementation). interface to the interface file, and the implementation corresponds to the implementation file. The
An object is an item. Object-oriented programming can be seen as an artifact and something you want to do with it. This differs from the C language in that C is often referred to as procedural language. In C, it is usually the first thing to think
1. Memory Management
Heap and Stack
Stack (operating System): automatically allocated by the operating system release, storing the function parameter values (parameters), the value of local variables and so on. It works like a stack
In object-oriented languages such as java/c#, access to a method can be controlled through public/private/protected to control its access rights. In OC, however, the method does not have access modifiers. So do we have a way to make it private?1. If
1, OC IntroductionFull Name: Objective-c is an object-oriented programming language that expands C and is used primarily for iOS and Mac OS development.
On the basis of the C language, a minimal object-oriented syntax is added.
Fully
1. Prototypesprototype Design pattern the so-called prototype design pattern, in fact, is the object copy, this feature in all languages are basically exist.We know that in OC, Object assignment is actually a reference copy of an object, which is
A moral integrity programmer cares about the warning of his code, just like a dead cockroach on the edge of a job. --@onevcatattention to compilation warningsThe compiler can now be noisy, and the warnings given by the compiler are useful
Main references in this series:Objective-c Runtime ReferenceObjective-c Runtime Programming GuideMajor documents involved: Objc/message.h,objc/objc-api.h,objc/objc.h,objc/runtime.hCool bar [tekuba.net] Use the Creative commons agreement "attribution-
A. dot Syntax The essence of point syntax is method invocation , not access member variable, compiler sees point syntax has two kinds of processing 1 . is an assignment, the assignment is to expand to the set method 2. Not assignment: expand
The copy of the object is to copy an object as a copy, and he will open up a new memory (heap memory) to store the replica object, just as the file is copied, that is, the source object and the replica object are two different areas of memory.
Nil: A null pointer to an Objective-c object.(#define NIL ((ID) 0))Nil represents a Objective-c object with a pointer to an emptyNil: A null pointer to an OBJECTIVE-C class.The first capital of nil and nil is a bit different, nil defines a pointer
Original article address:
Http://blog.csdn.net/kindazrael/article/details/8108868
In C, Preprocessor is a powerful tool that makes your code easier to read and modify. With preprocessing code, you can redefine a part of the code to make your code
Do not repost the labor results of developers
Some key concepts of object-oriented programming are mainly focused on syntax related to objective-c Definition classes.
The OC object-oriented concept is similar to that of other languages. It is
Discussing a strange concept of objective-C: meta-class
Every class in objective-C has its own meta-class, but it is mysterious because you seldom use meta-class directly.
Create a class at runtime
The following code creates a new nserror subclass
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