I have studied objective-C over the past few days and briefly talked about my understanding and views on its memory management mechanism. If you have any ideas or different opinions, I can share them with you, first, objective-C uses the reference
Protocol: Protocol (equivalent to the interface in C)
The protocol can be used at most in proxy mode and observer mode.Classes in OC only support single inheritance,
May comply with multiple protocols Define a protocol named myprotocol @ protocol
The nsdate class is used to save time values. It also provides some methods for processing time interval operations and comparison between dates.
1.The following methods are available for creation or initialization:
Used to create nsdateThe
---------------------- ASP. NET + unity development,. Net training, and hope to communicate with you! ----------------------
I. Object-oriented 1. Differences between object-oriented and process-oriented ideas
OC is object-oriented and C is process
The attribute mechanism in objective-C 2.0 provides us with a convenient way to obtain and set instance variables. It can also be said that the attribute provides us with a default configurator and accesser implementation. Before learning the
1. most of the time, we need to ensure the security of read and write data. At this time, it is best not to use @ synchronized synchronization block, because the code in the synchronization block must be executed separately, this may cause the
Some methods of string usage:
1. Create a dictionary nsstring variable string, and nsmutablestring immutable string. They are both objective objects.
Char * STR is an array of letters.
2. String formatting: stringwithformat, which is used to
Article 11th: understanding the role of objc_msgsend
Calling methods on objects is a frequently used function in OC. In OC terminology, this is called "pass a message ). A message contains a "name" or "selector", which can receive parameters and may
Background: Currently, many IOS projects convert JSON data into an object for storage. Assume that this object has an attributes named myname of the nsstring type, and this attributes is always nil. After this object is created, it is not assigned a
1: Class class:Typedef struct objc_class * class;From the definition of Class, we can see that it is a pointer to the objc_class structure type. What is objc_class?
Struct objc_class {struct objc_class * ISA; struct objc_class * super_class; //
Objective-C contains nsstring, nsmutablestring, nsarray, nsmutablearray, nsdictionary, and nsmutabledictionary.
First, nsstring, nsarray, and nsdictionary are immutable. Once space is allocated, the length is fixed. The other three classes are
? ? The notification is a simple analogy. the boss of the company sent a notification to the following employees, saying that the company will go public tomorrow and all departments should make preparations. After the notification is sent, each
There are some methods for passing functions in various languages: function pointers can be used in C language, and function references, imitation functions, and Lambda are available in C ++, and Selector is also available in objective-C) and
1. What is a protocol?
2. Description and use of protocols and categories
1. What is a protocol?
In objective-C, multi-inheritance is not supported, that is, a class cannot have multiple parent classes, but OC provides similar implementation
Objective-C is a class-based object system. Each object is an instance of some class; the object'sisaPointer Points to its class. that class describes the object's data: allocation size and Ivar types and layout. the class also
In Objective-C language, there are two ways to pass the method: ① Selector ② Blocks. This article mainly describes Selector. Blocks will be summarized later.
Message Passing is the core mechanism of Objective-C language. In Objective-C, there is no
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