@ Interface => start to define a class.
@ End => end
@ Implementation => class implementation
@ End => end
# Import => reference header files
@ Property => Objective-C 2.0 syntax, defining an attribute
ID
ID
In objective-C, the process for defining a singleton class is as follows:
1. Define a static class object. The initial value is nil.
2. In the factory method (generally named "sharedinstance" or "sharedmanager"), use allocwithzone only if
Common nsobject methods:All OC objects have these methods. See the Demo code.
Reflection:Class reflectionInstantiate an object using a string of the Class NameClass class = nsclassfromstring (@ "student ");Student * Stu = [[class alloc] init];
Class
Some time ago, I participated in an objective-C project using the C ++ library. I wrote an article about mixed editing, but the result was unexpectedly one of the top results about objective-C ++ in Google search.
Later, Apple uses clang Based on
It took me one afternoon to finish reading "objective-C development sample code Daquan". This book is suitable for programmers with or without any foundation, from shortest to deep, this article describes the solutions to common problems in MAC and
Blogger: Yi Feifei
Link: http://www.yifeiyang.net/iphone-development-advanced-1-depth-understanding-of-iphone-os-sdk-and-objective-c-2-0/
Reprinted text.Advanced iPhone development (1) --- in-depth understanding of iPhone OS/SDK and objective-C 2.0
The following are the notes for learning objective-C 2.0. The original book I purchased is the original English version. Due to my limited level of English, there may be omissions in understanding.
Original book purchase address: Amazon
5. Memory
The following are the notes for learning objective-C 2.0. The original book I purchased is the original English version. Due to my limited level of English, there may be omissions in understanding.
Original book purchase address: Amazon
6. blocks
The memory leakage problem in objective-C program development is a headache for beginners. It may be that the C # language is too used to automatic spam release, I used the profile tool in xcode to check the small program I wrote, and the memory
Class type
So far, we have known the SEL data type corresponding to the method. Like Sel, in objective-C, we can not only use the SEL corresponding to the method, for Classes in objective-C, a similar mechanism is also provided for us, class type.
1. Hungary naming and do not blindly use Hungary naming
Naming Conventions are the most important and the most controversial part of the procedural writing norms. They have been a place for military personnel since ancient times. What is the use of
IOSDevelopmentObjective-CAndJavascript InteractionThe operation is the content to be introduced in this article. It mainly explains the usage of stringbyevaluatingjavascriptfromstring. It is very powerful and easy to use, through this, we can easily
Nonatomic: Non-atomic access, no lock when assigning values to attributes, multi-thread concurrent access will improve performance. If this attribute is not added, both access methods are atomic transaction access by default.
(Atomic is a thread
Uiwebview is one of the most commonly used sdks for iOS. It has a stringbyevaluatingjavascriptfromstring method that can embed Javascript into the page. Through this method, we can interact with webpage elements in uiwebview in
Memory management basics
When you write an application for Mac OSX, you can choose to allow garbage collection. This means that you do not have to consider memory management if it is not particularly complex. However, you will not always work in an
1. When using xcode to create an objective-C source file, you can check the function of generating a. h file at the same time. xcode is automatically selected here.
2. The code is automatically completed, and the xcode code is automatically
Objective-C: Empty segment Selector
Prelude
Objective-C has a personality. A distinctive feature is that method functions are segmented, that is, function names are not written together, but are split into N segments, which correspond to N
From http://blog.kungfusoft.com/programming/iphone/topic-281.html
When using functions such as nslog and [nsstring stringwithformat:], they all work based on C/C ++-style string formatting.
Originally, C/C ++ has never been used. In iPhone
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