1. Inheritance mainly reflects the relationship between classes. Using inheritance can reduce repeatedCode.
2. Inheritance Mechanism Method lookup: If a message is sent to an object, the schedulingProgramFind the method corresponding to the
Category)['K processing Ti processing equipment Ri]N. Category, category; CategoryDefinition: Add a new method to an existing class I. Declaration category
The Declaration format of a category is similar to that of a category, as follows:
@
1. Create strings and class methods
Create an nsstring using the formula
+ (ID) stringwithformat :( nsstring *) format ,......;
Eg:
Nsstring * height;
Height = [nsstring stringwithformat: @ "height: % d length: % d", 10, 20];
The
Similar to C #, OC also has a root type, that is, nsobject, which contains an alloc method and an init method. As the name implies, alloc is used to apply for memory, create an internal structure of an object, and assign the instance variable to 0.
Objective-C method call Process
Objective-C is a dynamic language. The dynamic words are mainly reflected in the dynamic search method when we call the method, and then the corresponding function address is called. The runtime is the entire
1. Learn the C language basics first;
2. Read programming in objective-C 2.0. Do not read objective-C 2.0.
Program Design;
3. Read "cocoa Design Patterns" and "cocoa programming developer's handbook". Do not read them because they are difficult and
Numeric value to boolean type,1. nsstring contains many features. For example, it can be directly converted to the numeric type (integer or floating point type)
1Nsstring * test =@"This is my name";
2
If (Nsorderedascending = [test compare:
1 objective-C: variable and indirect.
Variables are indirect. By assigning a value to a variable, you only need to modify the value of the variable, instead of changing the appearance of the variable one by one.
Files are indirect. Mainly
From: http://www.cocoachina.com/macdev/objc/2010/1104/2296.html
This section parses the htmlCodeShared by cocoachina member "Yuehua Water", we hope to help developers
# Import "stringchuli. H "/* Project role: link network resolution HTML */@
From: http://www.yifeiyang.net/iphone-development-techniques-of-the-tools-for-chapter-1-the-xib-file-is-converted-to-objective-c-source-code/
Nib2objc is a small conversion tool that can automatically convert XIB files to objective-CSource
Objects and ClassesA class consists primarily of two things: variables that can store data and methodsThat can perform operations.
SubclassesClasses can also inherit functionality from an existing class
Instance and class variables
Changing
The interface is often used during iPhone development. Apple has designed a good management idea for it, that is, using the common MVC mode. In the iPhone, all graphical controls are inherited from uiview, that is, "V ". uiview and its Child classes
From: http://blog.csdn.net/hulefei29/archive/2010/02/21/5314018.aspx
Objective-C has almost become Apple's patent. You can compile the objective-C program directly on Apple's xcode, but there are few compilation tools on the Windows platform, not
I have seen a very good article that allows you to instantly understand what delegation is.
When we talk about the protocol, the declarative protocol is a reserved method body. The specific implementation of the method is waiting for the person who
An Introduction to objective-C Meta class
First, let's have a look at the base class nsobject.
@ Interface nsobject {// implement Protocol nsobject
Class ISA; // point to Meta class, all instances of nsobject share the same Meta class.
}
+ (Void)
1. Dynamic Allocation
Dynamic Allocation is handled by two functions: malloc and free. Use a parameter to call malloc to request memory. This function specifies the number of bytes required. Malloc returns a pointer to the number of bytes in the
Using property in objective-C
Disclaimer (read only !) : The original translations of all tutorials provided by this blog are from the Internet and are only for learning and communication purposes. Do not conduct commercial communications. At the
Copyright Notice
This article is copyrighted by Vince Yuan (vince. yuan # gmail.com. Welcome to non-profit reprint, reprint must contain the original link http://vinceyuan.cnblogs.com, and must contain the complete content of this copyright
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