OC and C + +, Java and other object-oriented languages have a lot of similarities, but in many ways is also different. If you use an object-oriented language, it is easy to understand the paradigms and templates used by the OC language. But the use
Arrays are ordered, can only hold objects, arrays have the concept of subscript (index), index elements by index, subscript starting from 0, the array is divided into non-variable groups (Nsarray) and variable arrays (Nsmutablearray).Immutable
Objective-c is the base language for iOS development, hereafter referred to as OC1, OC and C language header file differences:#import: #include一样都是编译预处理指令#import function is the same as # include to copy the contents of the file to the location of
First, description methodThe description method includes class methods and object methods. (Included in the NSObject Class)(i) Basic knowledge-description (Object method)When you use NSLog and @% to output an object, the object's description method
1#pragmaMark-----------How arrays are initialized--------------2//Insert code here ...3//NSLog (@ "Hello, world!");4//How arrays are initialized5//1. Initializing an empty array6//Nsarray *array = [[Nsarray alloc] init];//immutable arrays, which
NSString, immutable strings, that is, content and length cannot be modified after creation.Nsmutablestring, a mutable string that can be modified after it is created.Immutable string (NSString)Create a string1 //Create a string2NSString *STR1 =
Fourth Chapter Successioninherited syntax format: @interface circle:nsobject. The mark behind the colon runes the class that needs to be inherited. Multiple inheritance is not supported in OC. The first program with an inheritance@interface
Table of Contents
Object model (structure definition, class object, Meta class, and instance object relationships)
Message delivery and forwarding mechanisms
Runtime System Functional Understanding
Object model Structure
recently saw a lot of block related articles, are saying block how to use, writing is very exciting. Blogs:What to note about block programming (use related)http://www.cocoachina.com/macdev/cocoa/2013/0527/6285.htmlprobe into block implementations
//Main.mFilesearchtest//Created by Zhang Leonardo on 11-10-31.Copyright (c) 2011 __mycompanyname__. All rights reserved.to discuss Via:www.renren.com/leonardozhang//#import int main (int argc, const char * argv[]){@autoreleasepool {Nsfilemanager
There are two ways of creating new objects in obj: [classname new] and [[ClassName Alloc] init]. The two methods are equivalent, and the Cocoa Convention is to use Alloc and init.1. Assigning objects:Allocation is a new object birth process that
@ stands for "Objective-c" logo that proves you are using objective-c languageObjective-c language keywords, @property paired with @synthesize.function: Let the compiler automatically write a method declaration with the same name as the data member,
In objective-C 2.0, there are two ways to extend the implementation of existing classes without using class inheritance. One is classification, and the other is class extensions ). The former can extend the implementation of classes without the
note that the following syntax requires downloading xcode 4.4. 1. Enumeration type change old Syntax: [CPP] view plaincopy typedef Enum week { moday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday } week; the problem with the old
Understanding the meaning of @ class in objective-C
In objective-C, when a class is used to another class and the referenced pointer needs to be created in the Class header file,
The following code is used:
A. H file
C code
# Import "B. H"
@
From: http://iosdevelopersnote.blogspot.com/2010/11/block.html
Blockapple adds Block Extension usage in C, objective-C, C ++. Currently, only Mac 10.6 and iOS 4 are supported. A block is composed of a bunch of executable programs. You can also
Automatic type conversion or forced type conversion can be performed based on the storage space occupied by data types. The general principle is that the data type of small storage capacity can be automatically converted to the Data Type of large
The first thing to note is:
Although gnustep can be installed and used on Windows, it is mainly intended for Linux users rather than Windows users. If you have good Linux development experience, it is good to use gnustep. Gnustep is not powerful and
C # sister:Memory cleanup is just as troublesome as demolition in life.
Aunt Objective-C:Yes, the split is not split, it occupies space, it should not be split, the program crashes
C # sister:To put it bluntly, the difficulty is not solved. In terms
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