Objective-c is the best Class C, object-oriented programming language I have used. Objective-c is perfectly compatible with standard C, and on top of this is the Smalltalk element that interprets the fundamental concept of object-oriented, making it
1, OC language is evolved from Smalltalk. The language uses message structure rather than function call.In the language of the message structure , the code executed by the runtime is determined by the operating environment;The compiler does not need
The block syntax was added in the iOS4.0 SDK , where more than a dozen APIs were used to block syntax. The block object is also inherited and NSObject, and is a C-language-level syntax and runtime feature . Similar to the standard C function
Objective-c Object-Oriented programmingDirectory
Understanding of object-oriented programming thought
Declaration and definition of a class
Instantiation of a class
Inherited
To write your own class library
In the previous blog post, we had a simple "car model" to explain the composite relationship . In today's blog post, we'll go on to the last example, explaining the use of the access (accessor) method . The so-called access method is the method used
// Nsvalue can convert the C type to an objective-C object, such as nsange, cgpoint, cgsize, cgrect, cgvector, uiedgeinsets, and uioffset nsange range = nsmakerange (0, 1 ); nsvalue * rangevalue = [nsvalue valuewithrange: range]; // nsvalue converts
What is objective-C? Objective-C is (OC ).
OC is a superset of C and fully compatible with C language. In addition to the features of C language, it also adds some new features, starting with @, such as @ interface and @ implementation.
@ Interface
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
Basic Principles:
1. What is memory management?-The memory of mobile devices is extremely limited, and each app can occupy a limited amount of memory.-When the app occupies a large amount of memory, the system will issue a memory warning, in this
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
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:
#
Conversion from: instancetype and ID keyword in objective-CI. What is instancetype?
The same as the ID indicates an unknown object.
2. Related Result types)
According to the naming rules of cocoa, the following rules are met:
1. In the class method,
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:
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
Enum and typedef, two examples are shown in the two sections respectively, as shown below:Enum direction {north, south, east, west };
Typedef Enum {north, south, east, west} direction;
I can't help wondering what are the differences between the
Do not repost the labor results of developers
The control statements in objective-C include the following:
? Branch statement: If-Else, switch
? Loop statement: while, do-while,
? Jump statements related to program transfer: Break, continue,
Do not repost the labor results of developers
C language was first developed at the at&t lab,
The development of Unix OS has promoted the rapid popularization of C language. Almost all unix OS are written in C language.
Brad J. Cox designed the
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