Compared to the simple factory model, only one factory can produce the mobile phone is also fixedThe abstract factory model is similar to having many factories that create a factory to produce when a user wants to buy a cell phone.For example, a
The first type: (The simplest nsdate)NSDate* tmpStartData = [NSDate date];//You code here...double deltaTime = [[NSDate date] timeIntervalSinceDate:tmpStartData];NSLog(@"cost time = %f", deltaTime);The second type: (Put the running code in the block
Words don't say much, learn so much, write a quick sort first.In addition to the Quick platoon, there is time to add heap, merge and so on.Learned today, classes, protocols, grammars.Because the algorithm class, more than one algorithm. So create a
Array Class :Ordered collectionNot variableAn array in OC is a container that can manage a series of elements in an orderly manner , with different element types, but must be object types.Initialization Method :1.initWithObjects:2. Convenience
Compounding : Combining multiple components together to form a whole and then work with the whole, which is called a compositeThe overall function is more powerful after compoundingWrite a house class, composed of doors, windows and so on, doors
Original address:http://tech.glowing.com/cn/objective-c-runtime/Hara GupengIf there is infringement, please contact me to deleteObjective-cObjective-c extends the C language and joins the object-oriented and Smalltalk messaging mechanisms. The core
Classes are the core of objective-c, and objective-c programs are all around classes. The OBJECTIVE-C program consists of at least the following three parts:1. Class Interface: Defines the data and methods of the class, but does not include the
#import int main (int argc, const char * argv[]){/** below is a basic type literal example */int a = 10; 10 is an integer literalfloat F = 0.5f; 0.5f is a single-precision floating-point number literalDouble d = 3.14; 3.14 is a double-precision
CocoaPods: A objective-c management tool for third-party librariesIntroduced:Third-party libraries are indispensable when developing applications, which can improve the efficiency of development. Some frequently used libraries, in the new project
This article turns from: Http://blog.csdn.net/yuquan0821/article/details/6646400/, overviewKVO, Key-value Observing, provides a mechanism for the object to receive notification when the properties of the specified object have been modified. Simply
Protocol protocolProtocol: Used to declare a method1. Definition of the Agreement@protocol Agreement name Method declaration List ....@end2. How to comply with the agreement1> Class Compliance Agreement@interface Class Name: Parent class name @end2>
Special types of wrapper classes: arrays, structs (internal OC, custom), pointers1 //2 //main.m3 //05-nsvalue4 //5 //Created by Ma C on 15/8/17.6 //Copyright (c) 2015 BJSXT. All rights reserved.7 //8 9 #importTentypedefstruct One { A Char*name; -
The difference between atomic and nonatomic: Atomic: When setting the @property property of a member variable, the default is atomic, which provides multithreading security. Because of multithreading, all objects in the operation of the member
1 //Complex.h2 //03-Dynamic binding3 //4 //Created by Ma C on 15/8/11.5 //Copyright (c) 2015 BJSXT. All rights reserved.6 //7 8 #import9 Ten @interfaceComplex:nsobject One@property (nonatomic,assign) cgfloat real;//Real Department A@property
An object of type ID in Objective-c can be converted to any kind of object, somewhat similar to the effect of a void* pointer type. The following is a brief description of the ID type.ID Marker: Common Object type. The ID type is a unique data type
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