In this paper, the definition and usage of the structural body nsrange,nspoint,nssize (cgsize) and Nsrect in Objective-c are described in detail, as follows:
1, Nsrange:
Nsrange's prototype is
typedef struct _NSRANGE {
nsuinteger location;
In objective-c, sending messages to nil is not crash.
The reason is that when the execution ID objc_msgsend (id self, SEL op, ...) method, if self = nil, the function does not perform any meaningful action and returns directly.
The return value
• Inheritance is one of the important concepts of object-oriented, and subclasses can inherit certain methods and member variables of the parent class. Member variables that have a scope qualifier of private are not inheritable. The child can also
Objective-c is a simple, powerful and flexible programming language with both object-oriented features and functional programming features. Because it is a C-language vest, that is, objective-c can convert its source code into a pure C language and
I. Archiving and unarchiving in the nscoding agreement(1) Archiving an object that will record all properties of this object to filesystem;(2) unarchiving an object and re-creates the object from data.The strength of the class to archiving and
Understanding Method Swizzling is a good opportunity to learn the runtime mechanism. Not much to do in this, only translated by Mattt Thompson published in Nshipster's method swizzling article.Method Swizzling is a technique that changes the actual
The protocol in OC is similar to the excuse of Java
The Protocol is special.ProgramDesign Patterns are used to declare methods implemented by other classes. Protocols are useful in the following scenarios:
1. There must be other class
Reference: http://hi.csdn.net/hou_cocoa
Cocoa
It is a native compiling environment on Mac OS X. It contains two frameworks, namely a series of class libraries, foundation and appkit.
On your iPhone and other handheld devices, the app uses a
Using Arc can help us reduce a lot of memory management burden, especially when we use JavaProgramPersonnel. However, I am not a strong Java Foundation. After two years of development, IOS has become accustomed to manual memory management, and arc
The basics of objective-C are supported by the GNU Compiler Collection. in order to utilize the full power of objective-C together with the cocoa/openstep environments on Linux, and to work with privileges of the examples covered in this book, it is
To use the prompt function of xcode, you only need to remember the class name and common functions. Other functions can be viewed as prompted. Press ESC to view functions of this class.
Foundtion framework
The cocoa program mainly uses two
Object archiving refers to writing an object into a file and saving it on the hard disk. When the program is blocked again, these objects can be restored. Object archiving is also called object serialization or object persistence.
Persistent storage
Blogger: Yi Feifei
Link: http://www.yifeiyang.net/iphone-development-advanced-1-depth-understanding-of-iphone-os-sdk-and-objective-c-2-0/
Reprinted text.Advanced iPhone development (1) --- in-depth understanding of iPhone OS/SDK and objective-C 2.0
1 ID cattle [3];2 sel say;3 sel skin;
The ID cattle [3] defines an array used to store cattle or bull objects. This line of code is probably quite familiar to everyone, so I will not go into details here. Traditional arrays like this cannot fully
Class type
So far, we have known the SEL data type corresponding to the method. Like Sel, in objective-C, we can not only use the SEL corresponding to the method, for Classes in objective-C, a similar mechanism is also provided for us, class type.
It is not terrible for iPhone objective-C exc_bad_access to write programs with bugs. For most problems, it is not difficult to find the cause through simple log or code analysis. However, when the problem of exc_bad_access is encountered in
Objective-C syntax for object objects
If the original Yusong Momo article is reprinted, please note: It is reprinted to my independent domain name blogYusong Momo program Research Institute, Original address: http://www.xuanyusong.com/archives/401
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