ID data typeAny type of objects can be stored. In a sense, it is a common object type. For example,ProgramLine
ID number;
Declare number
ID type. You can declare a method to make it return values of the ID type, as follows:
-(ID)
Bibliography: Learn objective-C on the Mac
There are two ways to create a new object in OBJ: [classname new] and [[classname alloc] init]. The two methods are equivalent. Cocoa uses alloc and init.
1. Allocation object:
Allocation is the birth
Reproduced in: http://www.cnblogs.com/54007/archive/2011/02/11/1951355.html
In C #, we use interfaces to implement polymorphism. For example, the interface iob defines a method F. There are two classes A and B that implement the IOB interface.
Iob
The lock is the basis of the thread programming synchronization tool. The lock makes it easy to protect a large part of the code so that you can ensure the correctness of the Code. 1 use POSIX mutex
POSIX mutex lock is easy to use in many
KVC
[Object setvalue: avalue forkey: akey]; // assign a value to the akey variable of the object
Avalue = [object valueforkey: akey]; // obtain the value of the akey variable of the object
[Object setvalue: avalue forkeypath: akeypath]; // set
1. Why memory management?
If the system resources are limited, 30 mb of memory will be allocated to each program. If the memory usage exceeds 20 mb, the system will receive a memory warning. If the memory usage exceeds 30 mb, the sorry system will
Use objective-C to parse HTML or XML. The system uses either libxml or nsxmlparser. However, both of these methods require writing a lot of code to process captured content, which is not intuitive.
There is a better class library, hpple, which is
Http://unmi.cc/objective-c-dp-singletonObjective-C design pattern Singleton
2011-08-25-Unmi
As the simplest one in the design mode, the singleton mode is still used in many systems. There are always some instances that only need one of them from the
Cocos2d-x learning exchange group: 140326755
Email: hahayacoder@gmail.com
Background
I have been interested in mobile development and mobile game development, but has been in the soy sauce status, recently also learning cocos2d-x, and then by the
Objective-C Language Features
1. Objective-C is based on the C language. It is a design language that adds extensions to the C language to create and operate objects.
2. Objective-C is a superset of ANSI-C that can be mixed with C and C ++ code.
3.
1. Class Declaration
1-1 @ interface start and @ end
1-2 variables and methods cannot be mixed together, and instance variables must be placed in {}
1-3 no static or const instance variables. In the. M file, you can declare the static property: it
Recently, in the program, you need to declare a one-dimensional array in the C language in the objective-C class:
@interface CArrayTest : NSObject{@private BOOL testArray[4]; }@end
Declare attributes
@property(nonatomic,assign)BOOL testArray[4
Http://www.cocoachina.com/macdev/cocoa/2009/0611/255.html
Some readers mentioned the need to develop email programs on the iPhone a few days ago. In addition to sending emails using mailto, there are no other better methods in the iPhone SDK.
Here
Document directory
Nsarray
Variable Array
Enumeration
Quick Enumeration
Nsdictionary
Cocoa provides many collection classes for use. The following describes how to use the objects.
Nsarray
Nsarray is a cocoa class used to store an ordered
Document directory
Nsnumber
Nsvalue
Nsnull
Various numeric values
Both nsarray and nsdictionary can only store objects and cannot store any basic types of data, such as int, float, and struct. Therefore, we can use objects to encapsulate basic
Objective-C syntax quick reference by cocoa China
10 Apr
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,
1. Install the Compiler
There are many Objective-C compilers. LLVM is developed from GCC and is mainly used on Apple's platform. GNU can use GnuStep, which is a program called Objective c.Go to the download page and download the above three software
This blog introduces the length of the basic data type, how to use the basic data type in the array of Oc, and the conversion of other data types.
To demonstrate the basic data type example, we create an iPhone project class as an example.
1. Create
The core class for processing strings in Objective-C is NSString and NSMutableString. These two classes process most of the functions of strings in Objective-C. The main difference between the two classes is that NSString cannot dynamically modify
1. Objective-C Memory Management Overview:
Objective-C needs to consider memory management by itself. This is a great challenge for new programmers who have switched from Java, C # and other languages to the Objective-C platform. Fortunately, if you
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.