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 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
7. The
Recently in the company to do a handheld frog game project, is using C ++ write cocos2d-x development, it is the iPhone cocos2d framework of another language version of the implementation, the biggest advantage is that it can run across platforms.
Keep writing logs.
Differences between printf and nslog
Nslog will automatically add line breaks without adding line breaks. nslog will add time and process information, while printf will only output the input content without adding anything
In objective-C # What does Pragma mark mean?
The following code commands are often seen in the code in xcode ide:
The following code commands are often seen in the code in xcode ide:
# Pragma mark-# Pragma mark Initialization
# What is Pragma?
@ Property
Introduction
Objective-C language keyword, paired with @ synthesize.
Function: Let the compiler automatically write a method declaration with the same name as the data member to save the declaration of the read/write method.
For example:
1
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
Some of them haven't had time to read it. Put it here first: 1. Treat the object as memory.
The status of each object instance is saved in different memory regions. Therefore, the object creation and deletion actions are equivalent to the allocation
The following notes reference site: http://blog.csdn.net/huanglx1984/archive/2009/07/06/4325377.aspx
Currently, apple only uses objective-C as the supported language.
The differences with C ++ are:
All classes in the O-C must inherit from
I feel that objective-C is really a giggle! How can I write c ++?
# Import @ Interface main: nsobject { int number; int I, J; }-(void) SETI :( INT) II andj :( INT) JJ; -(void) print; @ property int number; @ end @ implementation main @
Learn objective-C
Original address http://cocoadevcentral.com/d/learn_objectivec/
Translator's preface
I saw this article on the Internet and thought it was very good, but it seems that no one has translated it into Chinese, so I am bold enough to
Log records
In objective-C, it is very easy to output log information to the console. In fact, the nslog () function is similar to the printf () function in C language.% @A symbol represents an object.
Nslog (@ "the current date and time is: % @",
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
In objective-C, the call method is calledSend message
The notification object performs an operation. Syntax:[Shape draw]
I. Class Declaration (Interface ):
@ Interface testcoop: nsobject {Int Imonth;Int iyear;Int iday;}
-(Void) setyear: (INT)
Document directory
Method swizzling is not Atomic
Changes behavior of un-owned code
Possible naming conflicts
Swizzling changes the method's arguments
The order of swizzles matters
Difficult to understand (looks recursive)
Difficult to
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
Objective-C syntax
Translate: sprouting stone
2010-03-10
Post please indicate to transfer Apple development Chinese Network (http://www.CocoaDev.cn)
The preceding description is an integral part of this document.
Objective-C is the most
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.