constructor function:Objective-c is an object-oriented language, and when we define a class in objective-c, we always provide an initialization method, which is commonly written by everyone:- (ID) init {//Call the parent class method, an instance of
Auto Free Pool
is a semi-automatic memory management methodAutorealease Method:-(Instancetype) autoreleaseThis method places the object in the auto-free pool, and all objects in the pool are destroyed when the pool is automatically freed.Common
objective-c and Core Foundation objects convert memory management to each otheriOS allows easy conversion between OBJECTIVE-C and Core Foundation objects, taking nsstring and Cfstringref as a direct conversion to no pressure:Cfstringref acfstring = (
Dictionaries are equivalent to maps in C + + STLDictionary Nsdictionary1 #import2 #import "AppDelegate.h"3 4 intMainintargcChar*argv[]) {5 //creating a dictionary from the @ symbol is actually a key-value pair container6Nsdictionary *dict =
Objective-c language is a dynamic language that puts a lot of static language in the process of compiling and linking things to the runtime. At the same time OC is also a simple language, a large part of the content of C, just add the language level
The difference between an object and a normal variable
If you ' re used to using terms like the stack and the heap, a local variable was allocated on the stack, while objects be a Llocated on the heap.
-(void) f{ int2;
1. Property
Basic use----the compiler will automatically generate a declaration of a property's Getter/setter method whenever it sees @property
2. @synthesize
@synthesize is a compiler directive that simplifies the
One, retain, copy, assign differenceConcept:Assign: Simple assignment, without changing the index count (reference counting).Copy: Create an object with an index count of 1 and then release the old objectRetain: Frees the old object, assigns the
# # # Objective-c KVC Self-active conversion type researchApple is very kind, KVC time to help us do some type of conversion, the law posted, for the participants to participate in the test@interface Entity:nsobject@property (nonatomic, copy)
UITableView occupies a very important position in iOS development and must be mastered.Before you learn UITableView, learn some basic concepts:
UITableView inherits from Uiscrollview, which is a control that can be scrolled vertically
Translated from obtaining pixel data from a UIImageUIImage is a very familiar data structure in iOS, which is very handy for storing images. In the OpenCV class library, where the image is stored using a different data structure, we have a problem:
Definition and use of a category
Definition and use of two extension
Definition and use of three protocol
Use of delegate
I. Definition and use of categoryCategory, category, or category. The primary role is to add
In fact, the OC object method (minus method) and the class method (plus method) are not independent of each other, they can also be inextricably linked, today we look at their mutual invocation of the problem. This example is based on the People
I. Concepts of classes and objectsTwo of the key concepts in OC are classes and objects, and the relationship between classes and objects is like the relationship between a mold and an item made with this mold. A class gives a uniform definition of
Learn Java students know Interface (interface), then there is no interface in the objective-c? In fact objective-c with protocol (protocol) to achieve, in objective-c specific how to use, we look directly at the code example.Studentprotocol . h
The Objective-c control statements have the following three categories:Branching statements: If-else,switchLooping statements: While,do-while,forJump statement related to program transfer: Break,continue,goto.
Branch statementsBranching
In my previous objective-C call C ++ code, I used a very stupid method to implement simple, small objective-C call C/C ++CodeIn this example, when I learned objective-C serialization and deserialization on the Internet today, I accidentally met a
Objective-C is the preferred language developed on Apple Mac OS X, and it is so brilliant. A few days ago, the author Dave dribin interviewed the father of objective-C, Brad Cox, to learn about how this great man views his programming path.
We all
Posing, as its name implies, means "impersonating". It is similar to categories, but essentially it is different. The purpose of posing is that sub-classes can impersonate parent classes, so that subsequent Code does not need to change the parent
Protocol in objective-C is the same as the interface in Java and the pure virtual class in C ++. Essentially, protocol is used for a communication protocol to be followed by a class, in this sense,
The objective-C protocol may be more appropriate.
1
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.