1. When you create an object using new, alloc, or copy, the Count retain of the object reaches 1. You must delete this object release or autolease. In this way, it can be cleared only when its lifecycle ends.
2. When you use other methods to obtain
I. Installation
Download four files from http://www.gnustep.org/experience/Windows.html
1. gnustep msys System2. gnustep Core3. gnustep devel4. Cairo backendInstall the SDK on D:/gnustep in sequence.
Ii. Encoding
Write in NotepadCodeThe
In objective-C, attributes are usually set with the following keywords:
-- Assign: Specifies the setter method to use a simple value assignment, which is the default operation. You can use this attribute for scalar type (such as INT. You can
1. Objective-C Polymorphism
1. Concept: Different implementations of the same interface
Different classes can define methods that share the same name.
The dynamic type allows the program to determine the object type until execution.
Dynamic Type
It is not terrible to encounter bugs when writing programs. Most of the problems are caused by simple log orCode analysis is not difficult to find the cause. However, in objective-C Programming, exc_bad_accessWhen the problem occurs, it is difficult
Document directory
Range
Geometric Data Type
Range
Typedef struct _ nsange {
Unsigned intlocation;
Unsigned intlength;
}Nsange;
This struct is used to indicate the range of related items, usually the character range in the string or the range of
Document directory
Nsnumber
Nsvalue
Nsnull
Various numeric values
Both nsarray and nsdictionary can only store objects and cannot store any basic types of data, such as int, float, and struct. Therefore, we can use objects to encapsulate basic
1 Preface
For us, the singleton mode is nothing more common, that is, a program has only one class instance. Today we will introduce the singleton code in objective-C.2. code example
Mymanager. m
# Import "mymanager. H "static mymanager *
1 Preface
The objective-C category provides a way to dynamically add new features to existing classes, instead of adding new features, categories can also be used as private functions of classes in Beijing. The header file and the implemented file
The category is a class, which is an existing class with new features added.Category is used to add a new method to an existing class. You can use the object of the existing class to call the added method without inheriting the existing class.The
Keyword in OC, @ property and @ synthesize pair.
Syntax:
@ Property (parameter 1, parameter 2) variable type variable name
@ Synthesize variable name
Function:
Let the compiler automatically compile a method declaration with the same name as the
The KVO key-value observer mode is an important mechanism of cocoa similar to the notification mode. When the attributes of the observer change, the observer performs corresponding operations.
Create a new person class to inherit nsobject, add the
Objective-C for Java programmer Part 1
Object and basic type
Java contains the original, or a small part.InternalType. Are these values the objects one of the largest semantic differences between Java and smalltalk. In smalltalk, the original type
The first thing to note is:
Although GNUStep can be installed and used on windows, it is mainly intended for Linux users rather than Windows users. If you have good Linux development experience, it is good to use GNUStep. GNUStep is not powerful and
1. First install the Objective-C Compiler
GNUstep Windows Installer provides a simulated development environment for Objective-C on the Windows platform. There are four software packages, including GNUstep System and GNUstep Core, GNUstep Devel and
1. Definition class: In. H files,
@ Interface Class Name: parent class name
{
Member variables;
}
Member functions;
@ End;
In the. m file,
@ Implementation Class Name
Member function definition;
@ End;
2. member function definition:-(Return
An example of learning the Foundation has used all the things mentioned above, which is not bad.
Code:
// The AddressCard interface declares the header file
AddressCard. h
# Import # import @ interface AddressCard: NSObject { NSString *
Java has a Map, which can store data in the form of key-value pairs. When the value is set, the corresponding value can be directly obtained through the key, which is convenient and quick. In Objective-C language, dictionaries do this. Like NSArray,
This blog introduces the length of the basic data type, how to use the basic data type in the array of Oc, and the conversion of other data types.
To demonstrate the basic data type example, we create an iPhone project class as an example.
1. Create
The code block is essentially similar to other variables. The difference is that the data stored in the code block is a function body. Using code blocks, you can pass in the number of parameters and get the return value just like calling other
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