In objective-C, after a class is correctly compiled, a variable exists in the compiled class to save information about the class. We can get this class through a common character string or through the generated object. After the class is
Category is a great concept. You can use a category to add new methods to any class, including those you do notSource code.This is very convenient.To add a new method to a class, we usually create a subclass.However, subclass is sometimes
It is not terrible to encounter bugs when writing programs. Most of the problems are caused by simple log orCode analysis is not difficult to find the cause. However, in objective-C Programming, exc_bad_accessWhen the problem occurs, it is difficult
Document directory
Range
Geometric Data Type
Range
Typedef struct _ nsange {
Unsigned intlocation;
Unsigned intlength;
}Nsange;
This struct is used to indicate the range of related items, usually the character range in the string or the range of
Boolean Type
The Boolean bool values in C are true and false, while the bool values in objective-C are yes and no. In fact, the bool of objective-C is actually a definition of the signed character type (singed char) (typedef), which uses an 8-bit
Some time ago, I took some time to touch objective-C and installed the "Black Apple" and Lion system. The version is 10.7.2. I also need to install the xcode development environment. The corresponding version is xocde_4.2_and_ios_5_sdk_for_lion.dmg.
1 Preface
For us, the singleton mode is nothing more common, that is, a program has only one class instance. Today we will introduce the singleton code in objective-C.2. code example
Mymanager. m
# Import "mymanager. H "static mymanager *
Keyword in OC, @ property and @ synthesize pair.
Syntax:
@ Property (parameter 1, parameter 2) variable type variable name
@ Synthesize variable name
Function:
Let the compiler automatically compile a method declaration with the same name as the
Copyright NoticeThis article is copyrighted by Vince yuan (Vince. Yuan # gmail.com. For non-profit reprinting, the original link http://vinceyuan.cnblogs.com/must be included, and the content of this copyright should be included.Version 1.1 was
# Import int main (INT argc, char * argv []) {@ autoreleasepool {nslog (@ "Hello world! ");} Return 0;} the class and method in C ++ have determined the objective -- V Class-> message during the compilation period. If no exception is thrown, for
The KVO key-value observer mode is an important mechanism of cocoa similar to the notification mode. When the attributes of the observer change, the observer performs corresponding operations.
Create a new person class to inherit nsobject, add the
Set a set of first-level single-value objects, which can be variable or unchanged. Operations include: searching, adding, and deleting members in a set (common to variable sets), comparing two sets, and calculating the intersection and union of the
1. Definition class: In. H files,
@ Interface Class Name: parent class name
{
Member variables;
}
Member functions;
@ End;
In the. m file,
@ Implementation Class Name
Member function definition;
@ End;
2. member function definition:-(Return
The Foundation framework allows you to use the file system to perform basic operations on files or directories. These basic operations are provided by the NSFileManager class,
Methods of this class have the following functions:
Create a new file
Address: http://www.cocoachina.com/macdev/objc/2012/0613/4355.html
When to use self. most of the replies in the online search or forum are simply said that this is related to the objc access method, few people have answered the question about the
Java has a Map, which can store data in the form of key-value pairs. When the value is set, the corresponding value can be directly obtained through the key, which is convenient and quick. In Objective-C language, dictionaries do this. Like NSArray,
1. Introduction:
Property is a keyword of Objective-C. It is used in conjunction with @ synthesize to enable the compiler to automatically generate a method declaration with the same name as the data member. @ Synthesize is used to generate the
Document directory
Search
Initialization
Add a Library:
Header file path
Other third-party libraries.
Introduction:
Third-party libraries are indispensable during application development, which can improve the development efficiency. Some
Introduction:
In the previous article, we talked about KVC. In this article, we learned KVO. The full name is: Key Value Observing. the literal translation is: Key Value-based observer.
So what is its use? KVO is mainly used for view interaction.
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.