Nsarray is a static array that does not modify or add elements to the array. Therefore, nsarray alone is not enough. Nsmutablearray came into being to meet our needs.
Summary of common nsmutablearray Methods
Array
Create
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
in objective-C, the real implementation of message and method is bound in the execution phase, rather than the compilation phase. The compiler converts the message to the call of the objc_msgsend method. the objc_msgsend method contains two
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
ID data typeAny type of objects can be stored. In a sense, it is a common object type. For example,ProgramLine
ID number;
Declare number
ID type. You can declare a method to make it return values of the ID type, as follows:
-(ID)
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:
Bibliography: Learn objective-C on the Mac
There are two ways to create a new object in OBJ: [classname new] and [[classname alloc] init]. The two methods are equivalent. Cocoa uses alloc and init.
1. Allocation object:
Allocation is the birth
The lock is the basis of the thread programming synchronization tool. The lock makes it easy to protect a large part of the code so that you can ensure the correctness of the Code. 1 use POSIX mutex
POSIX mutex lock is easy to use in many
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{
Nsmutablestring common methods for modifying strings
+ (ID) stringwithcapacity: Size
Create a string with the size
-(ID) initwithcapacity: Size
Initializes a string with the size
-(Void) setstring:
After using objective-C language for iOS development for a period of time, I found my language base was relatively weak and began to make up for my shortcomings. I found that after using a language, I can look back at many of its principles to find
Http://www.codeios.com/thread-26-1-1.html
Because the ios sdk is relatively low-level, developers have to do more physical work. Fortunately, there are many third-party class libraries that can be used to simplify a lot of unnecessary work. after
Struct is often used in C/C ++ development to help us encapsulate basic data types. In objective-C, struct can also be used to encapsulate data types. At the same time, cocoa touch also provides an nsvalue to help us better use struct in development.
Recently, in the program, you need to declare a one-dimensional array in the C language in the objective-C class:
@interface CArrayTest : NSObject{@private BOOL testArray[4]; }@end
Declare attributes
@property(nonatomic,assign)BOOL testArray[4
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,
Http://www.cocoachina.com/macdev/cocoa/2009/0611/255.html
Some readers mentioned the need to develop email programs on the iPhone a few days ago. In addition to sending emails using mailto, there are no other better methods in the iPhone SDK.
Here
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
Boolean Type
The Boolean bool values in C are true and false, while the bool values in objective-C are yes and no. In fact, the bool of objective-C is actually a definition of the signed character type (singed char) (typedef), which uses an 8-bit
1. Install the Compiler
There are many Objective-C compilers. LLVM is developed from GCC and is mainly used on Apple's platform. GNU can use GnuStep, which is a program called Objective c.Go to the download page and download the above three software
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