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
Nsdictionary serves the same purpose as the dictionary class in Java and provides a set of "key-value" pairs.
Summary of common nsdictionary Methods
+ (ID) dictionarywithobjectsandkeys: obj1, key1, obj2, key2, ...... Nil
An array is a set of ordered objects. In general, elements in an array are of the same type. Similar to variable strings and immutable strings, Arrays can also be variable or immutable.
Common nsarray immutable array Methods
The difference between the two is:
1. import will contain all information about this class, including entity variables and methods, while @ class only tells the compiler that the name declared after it is the name of the class. As for how these
Objective-c Protocol delegate implements Protocol-the Protocol. After using this protocol, you must follow this Protocol. The methods required by the Protocol must be implemented. Delegate delegate-delegation, as its name implies, is to entrust
Why is Stella SDK used?
Now cross-platform development tools more and more, such as the use of HTML5 phone gap, such as a name of the king proposed Cocos2d-x, there are many, these platforms can directly develop iOS and Android applications, but
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
1. Inheritance
1. Basic Concepts
A new class can be derived from an existing class. This process is called inheritance. A new class is called a subclass, and an existing class is called a parent class or a superclass.
2. inheritance features:
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
Nowadays, iPhone development is getting increasingly popular, and I am also eager to learn about objective-C. However, the company is a clear Windows XP system (not a sound picture of the company's machine) (^_^) and cannot learn and debug it. One
In objective-C, when a class needs to reference another class, that is, to establish a composite relationship, you need to create a pointer to the referenced class in the Class header file. For example:
Car. h
#import @interface Car:NSObject{
Reprinted please indicate the source: blog.csdn.net/zhangxingpingAttribute Declaration
The attribute Declaration uses the keyword @ property. The attribute declaration can be any part of the method declaration block in the @ interface class. @
Reprinted please indicate the source: blog.csdn.net/zhangxingpingAbout attributes
In C ++, you usually need to write the getter and setter methods to obtain or set the value of the instance variable. The two methods need to be displayed in the
Int ivisen = 1000;-(void) viewdidload {[Super viewdidload]; // do any additional setup after loading the view, typically from a nib. // int code block int Mutl = 7; int (^ visenblock) (INT) = ^ (INT num) {return num * Mutl ;}; nslog (@ "% d ",
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
Today, when implementing a function, I encountered an extremely strange problem:
The detailed description is as follows:
A series of buttons are defined in a view, and tags are set for them. Then, all buttons are associated with the same click event,
I bought this book "Learn objective-C on Mac". At the beginning, I bought a 250 page that looks quite thin. After reading it, I found that there are many common languages, the new features are all similar to those in C ++ and Java, that is, a new
Http://www.cocoachina.com/macdev/objc/2011/0124/2602.html
In the class implementation of objective-C, we often see the two keywords "self" and "super". Taking the previous OOP language experience as an example, C ++ assumes that self is equivalent
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
Basic data types (NSInteger, CGFloat) and C data types (int, float, double, char, etc)
// Int, or NSIntegerThat is to say, when int type variables are needed, they can be the same as the program that writes C,Use int or NSIntegerBut we recommend
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.