(From: http://blog.csdn.net/arthurchenjs/article/details/6699598)
If you want to write a class to ensure that only one instance exists and you can get the entry for providing services for this specific instance, you can use the single-State design
Most beginners who have a basic development experience on other platforms are eager to see xcode. After seeing the interface builder, they are eager to get started with the objective-C syntax, the first thought becomes daunting. Okay, I'm talking
My notes may be very simple, and I have not recorded many things. Because it doesn't matter to me, or I know.
I have fewer records on thinking about object ideas. This one is understandable when I was doing. net, so I didn't record much during my
Protocol in objective-C
Protocol
In short, it is a list of methods. The declared methods can be implemented by any class. This mode is generally called the (Delegation) mode.
In iOS and OS X, Apple uses a large number of proxy modes to implement
1. composite is implemented by including object pointers as instance variables.
@ Interface unicycle: nsobject
{
Pedal * pedal;
Tire * tire;
} // The pedal and tire composite the unicycle
2. Access Method-a method used to read or change the
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
Objective-C objc_class introduction nsobject
In objective-C, nsobject is the root class of most classes.
@interface NSObject { Class isa OBJC_ISA_AVAILABILITY;}
It has an ISA attribute and its type is class.
Apple has made the objc runtime code
I have been dealing with object-oriented objects for some time. At that time, I learned OOP through C ++, and later I came into contact with PHP and Java. Every OOP language is more or less different in Object-Oriented aspects. Now I am 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
? ? The Singleton mode is a simple design mode. The design mode is not only for some programming language, but also for other OOP languages such as C ++, Java, and PHP, I first came into contact with the design model through the "design model. This
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
@ Indicates the "objective-c" flag, proving that you are using the objective-C Language
Objective-C language keyword, @ property and @ synthesize pair.
Function:Let the compiler automatically write a method declaration with the same name as the
In iOS development, nslock is commonly used to achieve simple mutual exclusion. Nslock operations include lock, unlock, trylock, and lockbeforedate. Therefore, the so-called lock and unlock are simple thread locks. trylock and lockbeforedate are two
First of all, to learn objective-C (hereinafter referred to as OC) Well, you must have the foundation of C language, because OC is a superset of C language and OC is a process-oriented language. [C language is an object-oriented language]. Many
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
When we learn a new language, we always compare it with the familiar language to learn it, just like when we learn English, we must remember the Chinese meaning of words, to help us understand and remember words.
The following compares Objective-C
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