First, the class1. Class nameclass names should be prefixed with three uppercase letters (two-letter prefix for Apple's class reservation)
Not only the class, the public constants, protocol, etc. are prefixed by the same three uppercase letters.
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
1. Create a string
(1) Constant string
Copy Code code as follows:
NSString *string = @ "I am an iosdevtip!";
(2) Common methods of Creation
Copy Code code as follows:
NSString *string = [[NSString alloc] init];
An analysis of KVO examples
Recently encountered a problem, in the process of a comment interface in the project, because the direct use of the UIWebView to display a list of comments, the results of the page up and down there is a cgsize (320,65)
In the front, we know that the nature of the class is actually an object, is the class type, then the loading process is how? In fact, the loading process of the class is very simple, first load the parent class and then load the subclass, and each
Dynamic type and dynamic binding, ID can represent any pointer type, definition ID variable not added *Polymorphism means that member variables and methods defined in the parent class inherit from the quilt class, and can have different data types
Before their idle bored to write a few application of the Web page "purse software", in fact, like this "purse software" can also do very high-end atmosphere, through the WebKit implementation of Oc-js Bridge, can be very convenient to implement in
In the Foundation framework in Objective-c, file operations are implemented by the Nsfilemanager class.Here's an example of how to create a file, write to a file, and read the contents of a file:- (void) testfilecreate{Nsfilemanager*filemanager
Initializers refer to constructors in other object-oriented languages, such as Java.Objective-c also has an object constructor in the Init form of the method. However, there are no special behaviors in OBJC in these methods.By convention, program
Nscoder Class 1, overviewThe object's instance variables and other data are encoded as blocks of data, then they are present to disk, later read back into memory, and new objects are created based on the saved data, also known as serialization or
1: What is @property?In Objective-c, @property is the syntax for declaring attributes, which makes it quick and easy to create getter/setter methods for instance variables.2: The nature of @property?@property = Ivar + setter + getter, is actually
The stack, as a data structure, is a special linear table that can only be inserted and deleted at one end. It stores the data according to the advanced principle, the first data is pressed into the bottom of the stack, the final data is at the top
OC is an extension of the C language, and almost all applications on OS X or iOS platforms are developed in that language.
You can use the Toolkit cocoa (OS X System) and Cocoa Touch (for iOS systems) to develop fully functional objective-c
Where the property can be declaredProperty can be declared in the Class Interface section and class extension and protocolThe visibility of the propertyThe property in Objective-c is actually the getter and setter method. The property of a class can
First, the knowledge point:QQ Chat InterfaceUse of dual models (Datamodel and Framemodel)Use of UitextfieldUse of notificationsTwo ways to stretch a picture (the Resizeableimagewithcapinsets property of a Slicing/image object)EnumerationExtraction
I. Description The turntable is composed of four parts, the chassis, rotating disk, turntable hands, Start button, all affixed to the Self.view, another 12 show the winning level of uilabel affixed to the rotating disc, Animations are implemented
1. It is used to notify an object of what to do, that is, the notification object executes an action.
1.1. in objective-C, square brackets also have other meanings: they are used to notify an object of what to do.
For example:
[Shape draw];// This
PrefaceWhen I was a beginner at objectice-C, I always felt confused about the memory management mechanism of objective-C. The program often experienced memory leaks or inexplicable crashes. I have summarized my research achievements and experience
Copying an object is to copy an object as a copy. It will open up a new memory (heap memory) to store the copy object, just like copying a file, that is, the source object and the copy object are two different memory regions. The protocol or
What are the strings in objective-C syntax?
If the original Yusong Momo article is reprinted, please note: It is reprinted to my independent domain name blogYusong Momo program Research Institute, Original address:
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