Xcode provides the function of converting a source file into an assembly file, The Assembly Code is as follows: # Assembly output for assemble. C # generated at 2:29:34 pm on Monday, May 25, 2014 # using debug configuration, x86_64
Protocol: Protocol (equivalent to the interface in C)
The protocol can be used at most in proxy mode and observer mode.Classes in OC only support single inheritance,
May comply with multiple protocols Define a protocol named myprotocol @ protocol
Proxy design mode:For example, if you want to watch a movie, you need to buy a ticket ). In this way, we can find a proxy to buy tickets. 1. First define a Protocol @ protocol ticketdelegate
// Return the fare-(double) ticketprice; // The number
Point Syntax:
The essence of point syntax is method call.When the dot syntax is used, the compiler automatically expands to the corresponding method person * P = [person new];
P. Age = 10; // The Compiler automatically converts this line of code
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
As mentioned in the previous article, member variables are declared in a large pair of arc, while attributes are first declared by @ property and then synthesized by @ synthesize. Attribute is a new mechanism of OC language. In actual use, there are
Block is equivalent to the function pointer in C or C ++, and is equivalent to the delegate in. Net or Java.
// Block Declaration
Double (^ blockname) (double, double) =
^ Double (double firstparam, double secondparam ){
Return firstparam *
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
Recent review of learn objective-C on the Mac
In Chapter 4th, [Super setfillcolor: C] is called for rewriting. It may be because the translation logic is unclear. I wrote a small example to understand it.
Define a father class and son class
Father:
#
Object-Oriented Programming (1)
Process-oriented programming
C language is a process-oriented programming language. Let's take a piece of program code to gain a deeper understanding of process-oriented.
Draw a set chart:
//// Main. M // OC //
Objective-C adds the object-oriented Feature Based on the C language through a new set of syntax. The OC syntax frequently uses braces ([]) and does not limit writing very long method names, which often makes many people think the language is
? ? 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
Preface
Currently, objective-C (OC) is the core language for iOS development. It also works with C and C ++ during the development process. OC is mainly responsible for UI interfaces, C language and C ++ can be used for graphic processing. Recently,
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
Build the objective-C compiling environment directory under the dragon core 8089d-debian7
Install Related Files
Compilation parameter description
Simplify command line parameters
Actual compilation instance
Simple Description:
1: Class class:Typedef struct objc_class * class;From the definition of Class, we can see that it is a pointer to the objc_class structure type. What is objc_class?
Struct objc_class {struct objc_class * ISA; struct objc_class * super_class; //
Objective-C contains nsstring, nsmutablestring, nsarray, nsmutablearray, nsdictionary, and nsmutabledictionary.
First, nsstring, nsarray, and nsdictionary are immutable. Once space is allocated, the length is fixed. The other three classes are
When learning objective-C, it is easy for beginners to get confused about the memory management part. A major reason is that the reference counting principle is not clear, I cannot understand the reference quantity of objects, so that the object's
Objective-C Memory Management Summary of mutual conversion between core Foundation objects
IOS allows easy conversion between objective-C and core Foundation objects. For nsstring and cfstringref, direct conversion is free of pressure:
There are some methods for passing functions in various languages: function pointers can be used in C language, and function references, imitation functions, and Lambda are available in C ++, and Selector is also available in objective-C) and
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.