OC Memory ManagementFirst, the basic principle(a) Why memory management is needed.Because the memory of the mobile device is extremely limited, so the memory of each app is also limited, when the app consumes more memory, the system will issue a
directory of this document
Knowledge Review
One, custom construction method
Second, description method
Description: This objective-c topic is a prelude to learning iOS development, and to enable programmers with experience in
Over the years, OBJECTIVE-C has been developing and evolving. Although the core concepts and practices have remained unchanged, it has undergone great changes in many areas and made great progress. These changes improve features such as type safety,
Instance variable:In fact, the explicit point is Ivar + setter + getter (instance variable + access method), but in OC the attribute is more literal this series of special keywords makes OC properties somewhat different.Member properties We should
First, block syntaxBlocks: Block syntax, which is essentially an anonymous function (a function without a name), the implementation of the block variable holding function, which can be directly adjusted by the block variable. There is no
Application of runtime mechanism in OBJECTIVE-CFirst, the initial knowledge of the runtimeObjective-c is a dynamic language, the so-called dynamic language, is in the execution of the program dynamically determine the variable type, the
First, what is a null pointer and a wild pointer1. Null pointer1> A pointer that does not store any memory address is called a null pointer (null pointer)The 2> null pointer is a pointer that is assigned a value of 0, and its value is 0 before it is
Reference CountEach object has a multiple integer associated with it, called its reference counter or retention calculator, and when a piece of code needs to access an object, the code adds 1 to the object's reserved counter value, indicating that I
GeneratorGenerator, also a builder pattern, is also the design pattern when creating objects. There is a director (the conductor) in this mode, and the client knows that the class reference is used to create the product. There is also a builder
The class purpose definition is similar to the definition of a class:1. Statement@interface NSString (Csayhi) NSString is the target class; Csayhi is the name of the class, and there is no following: NSObject2. Realize@implementation NSString
Advantages:Defensive programming can detect errors early in development.Example code:The following is the implementation code for the associated access method.- (void) Settire: (Tire *) Tire Atindex: (int)Index{if(Index0||Index>3) {NSLog (@"Bad
Artifice refers to a skill and a product that is too kit and useless.Reprint please specify the source http://blog.csdn.net/uxyheaven/article/details/46391771We can define basic operators and types with macros.#define 加 +#define 减 -#define 乘
Inheritance, initialization method, convenience builderToday we are going to learn to inherit the initialization method and Traverse The constructor first we have to understand some conceptual things . Inheritance : In oc , inheritance is a single
We discussed the processing of classes and objects in runtime, and the handling of member variables and attributes. In this chapter, we're going to start talking about the most interesting part of runtime: the message handling mechanism. We will
1. Related ConceptsBefore this note is started, we need to understand the following concepts.1.1 Stacks and heaps in the operating systemNote: The heap and stack mentioned here are not the same as the heap and stack in the data structure.Let's take
Nonatomic: Non-atomic access, non-synchronous, multi-threaded concurrent access improves performance. If this attribute is not added, the default is two access methods are atomic transaction access.(Atomic is a thread-protection technique used by
Nonatomic: Non-atomic access, non-synchronous, multi-threaded concurrent access improves performance. If this attribute is not added, the default is two access methods are atomic transaction access.(Atomic is a thread-protection technique used by
ArticleDirectory
4. Inheritance
4. Inheritance
This series of lectures has a strong correlation. If you are reading this article for the first time and want to better understand the content of this chapter, I suggest you read it from
Preface
Currently, objective-C (OC) is the core language for iOS development. It also works with C and C ++ during the development process. OC is mainly responsible for UI interfaces, C language and C ++ can be used for graphic processing. Recently,
1. Steps for declaring a class interface:
1. Declare a class interface and add the class name with @ interfacekeyword.
2. Use {instance variable} to define various data members.
3. method declaration: declare a C function using the infix syntax and
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