Objective-c Simple encapsulation String storage operation, eliminates the middle sandbox processing way
Copy Code code as follows:
/Storage PublicKey and SessionID-writecontent:nil-only fetch data, others-modify the original content and
StatementConditional statement
The conditional statement body should always be surrounded by curly braces. Only one line of code is best added, otherwise it will bring security risks.
Copy Code code as follows:
Recommended
if
In the daily coding process, we almost developed the habit of using ID for all the return values of the indeterminate type. Indeed, Because it has a general-purpose pointer feature of the balm, plus instancetype after ios7.0. Many people have not
Agreement:
A protocol is not a class: it can only declare a method and cannot have any instance variables, it has two types: formal and informal, and the Protocol only declares files, no implementation files. Formal agreements are a
1. Add minus sign before methodThere is no concept of public and private in objective-c, that is to say that all are public. A minus sign represents the beginning of a function, method, and message. The plus sign means that you don't need to create
Uiimageview+faceawarefillThis category uses the Aspect fill content mode, which can be automatically adjusted to the image content, and when the face is detected, it replaces the center of the image with the center of the face. Test environment:
Category categories Relatedcategory是OC的特有的语法Declaration of classification@interface ClassName (CategoryName)NewMethod; //在类别中添加方法 //不允许在类别中添加变量@end
ClassName: Which class extension method needs to be given
CategoryName: Name of
1. Trigonometric FunctionsDouble sin (double); sineDouble cos (double); cosineDouble tan (double); tangent2, Inverse trigonometric functionDouble asin (double); Results between [-PI/2, PI/2]Double ACOs (double); Results between [0, PI]Double Atan
First of all, the role of their two, nil is to put an object's pointer to empty, just cut off the pointer and in-memory objects, it does not have any effect on the release of memory, and release is really used for memory release, after release, the
Access permissions for member variablesThe member variables in OBJECTIVE-C have the following three properties
Public (external and sub-class accessible)
Protected (sub-class accessible, externally inaccessible)
Private (external
———————————————————————————————————————————Class method① class Method:+ The beginning of the method (defined as the process form and the object method, just the + start, which is the only difference)The invocation of the class method:[Class name
The Declaration and implementation of OC methodThe declaration of the OC method is @interface outside the curly braces @end aboveThe implementation of OC method @end above in @implementationIn the OC method, one parameter corresponds to a
1. Add tags to your code#pragma mark-#pragma mark2. Dot syntaxPerson *p = [person new];The essence of point syntax or method invocationP.age = 10; [P setage:10];int a = P.age; [P age];3. Scope of member variables@public: The member variables of an
In objective-C, @ property, @ synthesize, and point syntax are related to two functions. One is the setter function, and the other is the getter function.
In the past, we used to define the setter and getter functions.
@interface Dog:NSObject{int
The purpose of the copy design: the original object will not be affected when the copy is changed.1. a copy of an object can be created using the copy or mutablecopy method.2. Copy needs to implement the nscopying protocol first, and the created
In the past two days, I want to see how the legendary iPhone application is made.
Taking this idea as a preliminary attempt, the first problem encountered was the establishment of the Development Environment on Windows. After all, it was just fun to
1. Why memory management?
If the system resources are limited, 30 mb of memory will be allocated to each program. If the memory usage exceeds 20 mb, the system will receive a memory warning. If the memory usage exceeds 30 mb, the sorry system will
Delegate)Is an object. The object of another class requires the delegate object to perform some of its operations.Creating an "NSObject" category is called creatingInformal agreement.Any class object that implements the method in the "NSObject"
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