OBJECTIVE-C Features

Source: Internet
Author: User

1. Compatibility

OC is an object-oriented C language that can have C and C + + statements in OC Code, which can call C functions or access methods through C + + objects.

2. String

OC usually does not use a C language style string. Most of the cases (strings in corefoundation are C languages) are strings of type NSString that use the foundation framework. The NSString class provides a class wrapper for strings, supports Unicode, printf-style formatting tools, and so on. It is placed before the ordinary double-quoted string with an @ symbol. such as: NSString *mystring = @ "LJSDFJSDLKFJ";

Framework: Like a package in Java.

Method: Necessarily a class or an object, that is, it must have a body. It is used in object-oriented languages.

Function: Used in a process-oriented language, it has no subject.

But in objective-c, methods and functions are available. such as: NSLog (), it has no subject, so it is a method.

3. Class

Objective-c is an object-oriented language, and defining a class is its basic ability.

The class declaration and implementation of OBJECTIVE-C consists of two parts: the interface part and the implementation part.

4. Methods

Objective-c is an object-oriented language, and the definition method is its basic ability.

The method in Objective-c is not "." Operators, instead of the "" "operator. Sometimes a method call is also called: a message is sent.

5. Properties

The Objective-c property is the concept proposed by the 2.0, which is a means of substituting the "Read method (getter)" and "Set Method (Setter)" For access to member variables (the property is instead the setter and getter method, plainly). In order to encapsulate a class, it is generally not directly accessible to member variables, but through property access.

6. Agreement

The protocol in OBJECTIVE-C is similar to an interface in Java or a pure virtual class of C + +, except that there is no implementation part of the interface Definition section, that is, only h files do not have m files.

7. Classification

The classification in OBJECTIVE-C is similar to the inheritance mechanism by which the functions of the parent class can be extended.

OBJECTIVE-C Features

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.