Object-orientedCLanguage
When it comes to object-oriented languages, most Windows developers first think of C ++, C #, or Java. However, if you first think of objective-C, you should be a developer in Mac OS, in this modern computer system, mac OS
Note: What I'm talking about is the difference between objective-C and Java. In the same place, I just want Java developers to quickly master and understand objective-C.
Objective-C is different from Java:
1. Pay attention to the memory
To set a breakpoint Objective C selectors namedAlignleftedges:You can enter either:
(Lldb) breakpoint set -- selector alignleftedges:(Lldb) breakpoint set-s alignleftedges:
You can limit any breakpoints to a specific executable image by using"--
You can use dictionaries to store data, which improves the search speed.
The following describes how to create a dictionary.
Nsdictionary * DIC = [nsdictionary dictionarywithobjectsandkeys:
@ "Wtq", @ "name1 ",
@ "WTM", @ "name2 ",
@ "WTP", @
1 objective-C: variable and indirect.
Variables are indirect. By assigning a value to a variable, you only need to modify the value of the variable, instead of changing the appearance of the variable one by one.
Files are indirect. Mainly
During the development process, we will encounter a lot of string operations. It is a common data type, and the usage of it is summarized below:
// 1. Create a constant string.Nsstring * astring = @ "this is a string! ";
// 2. Create an empty
From: http://www.cocoachina.com/macdev/objc/2010/1104/2296.html
This section parses the htmlCodeShared by cocoachina member "Yuehua Water", we hope to help developers
# Import "stringchuli. H "/* Project role: link network resolution HTML */@
I. Development Environment
If you use xcode, you can download it from the App Store. However, the download speed is too slow. You have downloaded and installed the command line tool on your own. I do not know whether the command line tool is
The automatic reference counting (ARC) is IOS 4.0 or later. You can choose to enable the memory management function when creating a project in xcode 4.2 or later. It seems to be a selectable function, but it has a great impact on programming after
1. @ public, @ protected, @ private
I personally think that there is no clear difference between @ public and @ protected. If the objects within their scope are not set to @ property, the object is equivalent to the protected object, only the
The following is a little bit of knowledge I learned during my learning process. Although it is superficial, I want to share it with you! I hope to give more advice.
First look at the code structureTestMain. mSceneManager. hSceneManager.
Custom class. On Object-c, a class is composed of a public header file. h and A private implementation file. m. the header file defines the class interface, starting with @ interface and ending with @ end as follows: # import
@ Interface Member:
NSSet and NSMutableSet are unordered, But they guarantee data uniqueness. When the same data is inserted, it will not have any effect. The internal implementation is a hash table, so you can search for a data within a constant time.
1. Use of NSSet[
This section describes Objective-C classes and class objects. The method is simple to use. 1. Classes and Methods
Class declaration syntax, declares a class called MyClass, which inherits from the root class: NSObject. (The root class can be
1. Introduction:
Property is a keyword of Objective-C. It is used in conjunction with @ synthesize to enable the compiler to automatically generate a method declaration with the same name as the data member. @ Synthesize is used to generate the
Document directory
Search
Initialization
Add a Library:
Header file path
Other third-party libraries.
Introduction:
Third-party libraries are indispensable during application development, which can improve the development efficiency. Some
Strong and weak are new object variable attributes introduced by ARC. The weak and strong attributes are required only when you open the ARC.
@ Strong is similar to @ retain
@ Weak is similar to @ assign, but @ weak has assigned a value to nil after
Note: This Objective-C topic is a prelude to iOS development. It also helps programmers with experience in object-oriented language development to quickly get started with Objective-C. If you have no programming experience or are not interested in
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