1, @class: declaration is a classWhen we actually use the class, import the class using import
2, the following code will be an error, because import can not reference each other, this is just a @class declaration class can#import "B.h"@interface A:
A framework is a collection of classes, methods, functions, and documents organized in accordance with certain rules, so that programmers can develop programs more easily and quickly. The cocoa program is written mainly in two frames Foundation and
"Basic Concepts"
1. Key-value encoding is a mechanism for indirect access to object properties, which allows access to object properties without invoking access methods and variable instances.
2. The key-value coding method is declared in the OC
Nsarray is an immutable group in the Foundation framework, let's implement these methods:
#import int main (int argc, const char * argv[]) {@autoreleasepool {//oc array can be Storing objects of different types; the array of OC can only store
(1) arraynsarray* array = [[Nsarray alloc] initwithobjects:@ "Hello" @ "World", nil]; Only object types can be stored, and the underlying type, such as int, may be converted to a string type and then passed in(NSString) [Array objectatindex:1];
The two most commonly used containers for storing data in OC are arrays and dictionaries, and as most commonly used, you should understand all the features and usages.an array in OC is a capacity, an orderly management of a series of elements, and
Continue learning Pointers:Here's a pointer to the pointerAs the name implies pointers to the pointer is a pointer to the address of a needle is also called a two-level pointer, nonsense say we see the code definition and effect#include intMain ()
A. Const1> for const, remember the key point, it just modifies the right variable.For example:- (void) viewdidload {[Super viewdidload]; //two usages of const//const: Modifier basic Variable P//The two formulations are the same, and the const only
First, the knowledge point simple introductionWhat is a 1.UIScrollView control?(1) The screen of the mobile device? Small is extremely limited, so direct exhibition, the content of the user's eyes is also very limited(2) When the exhibition shows
Objective-c on the basis of C language, added some of their own unique features, and in Objective-c compatible with the original C language usage. In Objective-c, there is a certain difference between implementing Hello World and C, as
NSDate: Acquisition and manipulation of time1. Get the current time1 // Get Current date 2 NSDate *date = sender.date; 3 NSLog (@ "%@", date);2. Convert date to string and format1 // " Span style= "color: #008000;" >date to string 2
Management scope: Any object that inherits NSObject, basic data types are not managedEssential reason: Because the object and the basic data type in the system storage space is not the same, the local variable is mainly stored in the stack, and the
#文档名: Programming with OBJECTIVE-C# #关于Objective-C (abbreviation OC)When writing programs to iOS and OS X, OBJECTIVE-C is the primary language used by programmers. OC is an extended set of C languages that provides object-oriented features and a
We know that in C, using sizeof () to calculate the number of bytes occupied in the memory, after referencing string.h, use strlen () to calculate the length of the string (not including).In Object-c, the "Length" method can return the length of a
In the program design, the use of functions undoubtedly greatly simplifies the writing of code, improve the efficiency of code operation, reduce duplication of code. So let's take a look at the method in detail. This example also takes the people
First knowledge of Objective-cWhen Objective-c was first born, the extension. m stands for message, which refers to a major feature of Objective-c.@“%d12 ); // 可以输出 12%d23 // 可以输出23@“%s “ , // 可以输出 字符串 abcprintf ( “%s” , “abc” ) ; // 可以输出
Using C ++ with objective-C
Apple's objective-C compiler allows users to freely mix C ++ and objective-C in the same source file. The compiled language is objective-C ++. With it, you can apply it in objective-C.
Program Use the existing C ++ class
Directory
About objective-C essenins
Why are you reading this?
Supported platforms
The history of objective-C
The C Programming Language
The Smalltalk Programming Language
Objective-C reflectionThis is what I will introduce in this article. When I first came into contact with Java, I thought the wholeReflectionThe packages are very novel, which makes Java and interpreted scripting languages closer, while also opening
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.