In the Objective-c language, Apple introduced two macros in iOS to redefine the enumeration type (that is, Ns_enum and ns_options), which is essentially the same as defining enumerated types, but in using Ns_enum for general enumerations, Ns_enumm
Objective-c is similar to object-oriented languages such as C + +, Java, but in many ways different. If you use another object-oriented language, you can understand many of the paradigms and templates used by objective-c. However, the syntax may
Synchronous
Asynchronous
Parallel
Serial
Task Group
Time to wait
There are two types of Dispatch queues:
1.Serial Dispatch queue, serial queue, can only perform one of the tasks that are appended to the thread at a
Objective-c expands C, and naturally many usages are consistent with C. For example, the floating-point number is converted into integers, there are four cases.1. Simple and rough, direct conversionfloat f = 1.5; int a; a = (int)f; NSLog("a = %d",a);
Underlying data type SelThe SEL, also called the selector, is a pointer to the selector that represents a method, which is defined as follows:typedef struct objc_selector *SEL;The detailed definition of the objc_selector struct is not found in the
Compounding:Composition in programming (composition) is like composing music (composition): Combine multiple components together to use them to get a complete work. In Objective-c, a composite is implemented by including an object pointer that is an
Objective-cClass, Object, methodThe actual variable is an instance of the class.The actions that an instance can perform are called methods.[Classorinstance Method];Defining classes@interface Classname:superclassDefine method as interface@endClass
NSNumber: is a class that handles numbers in OCNsvalue is a subclass of NSNumberHow to handle:Wrap the int,float,double into an objectBenefits of using NSNumber:You can save data of a basic data type to an array or dictionary//defining basic data
NSStringRepresents a string class in OC%@ is the format character for objects in OCprintf cannot print objects in OCBy stringWithFormat: This class method, print the formatted stringCasesint a = 10;NSString * str = [NSString stringwithformat:@
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
In a nutshell, a constructor is a function of initializing an object when it is created, initializing some of the member variables in the object, and the destructor is doing some cleanup work on the object being deleted, that is, the specialized
As with C and C + +, Objective-c also uses the header file and the implementation file (implementation files) to partition the code. The standard way to write "class" in the Objective-c language is to create two files with the name of the class name,
Most of the features in the runtime are described in the previous sections, including the processing of classes and objects, member variables and properties, methods and messages, classification and protocols. Most of the runtime's functions are
Objective-c, you can use #import and @class to refer to other types, but do you know what the difference is?@class is called Forward-class, you often see references through @class in the definition of a header file, because when you introduce a
---------------------- ASP. NET + unity development,. Net training, and hope to communicate with you! ----------------------I. foundation framework-struct
1. Basic Knowledge
Foundation-basic framework. The Framework contains many common data types,
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
C ++ and objective-C
Using C ++ with objective-CApple'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 use the existing C ++ class library in
I have seen many development languages, including C, C ++, Java, Python, Ruby, Lua, and PHP, basically, when I first read a new language, I can quickly guess the syntax characteristics of the language. However, when I first read objective-C, I was
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service